| Net-Whois-ARIN documentation | Contained in the Net-Whois-ARIN distribution. |
Net::Whois::ARIN::AS - ARIN whois AS record class
use Net::Whois::ARIN::AS;
my $as = Net::Whois::ARIN::AS->new(
OrgName => 'Electric Lightwave Inc',
OrgID => 'ELIX',
Address => '4400 NE 77th Ave',
City => 'Vancouver',
StateProv => 'WA',
PostalCode => '98662',
Country => 'US',
RegDate => '1995-07-25',
Updated => '2001-05-17',
ASName => 'ELIX',
ASNumber => '5650',
ASHandle => 'AS5650',
Comment => '',
);
printf "%s has ASN %d\n",
$as->OrgName,
$as->ASNumber;
The Net::Whois::ARIN::AS module is simple class which is used to store the attributes of an AS record in ARIN's Whois server. Each attribute of the AS record has an accessor/mutator of the same name.
This method accepts a list of Net::Whois::ARIN::Contact and associates these objects with the AS record. If no arguments are specified, the method returns a list of Net::Whois::ARIN::Contact objects.
print $o->dump;
These methods are the accessors/mutators for the fields found in the Whois record.
Todd Caine <todd.caine at gmail.com>
Copyright (c) 2004-2011 Todd Caine. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Net-Whois-ARIN documentation | Contained in the Net-Whois-ARIN distribution. |
package Net::Whois::ARIN::AS; our $AUTOLOAD;
use strict; use Carp "croak";
sub new { my $class = shift; return bless { _contacts => [], @_ }, $class; }
sub contacts { my $self = shift; $self->{_contacts} = [ @_ ] if @_; return @{ $self->{_contacts} }; }
sub dump { my $self = shift; my $record = sprintf "\nOrgName: %s\n",$self->OrgName; $record .= sprintf "OrgName: %s\n",$self->OrgID; $record .= sprintf("Address: %s\n", $_) for @{ $self->Address }; $record .= sprintf "City: %s\n",$self->City; $record .= sprintf "StateProv: %s\n",$self->StateProv; $record .= sprintf "PostalCode: %s\n",$self->PostalCode; $record .= sprintf "Country: %s\n",$self->Country; $record .= sprintf "ASNumber: %s\n",$self->ASNumber; $record .= sprintf "ASName: %s\n",$self->ASName; $record .= sprintf "ASHandle: %s\n",$self->ASHandle; $record .= sprintf "Comment: %s\n",$self->Comment; $record .= sprintf "RegDate: %s\n",$self->RegDate; $record .= sprintf "Updated: %s\n\n",$self->Updated; foreach my $contact ( $self->contacts ) { $record .= sprintf "%sHandle: %s\n",$contact->Type,$contact->Handle; $record .= sprintf "%sName: %s\n",$contact->Type,$contact->Name; $record .= sprintf "%sPhone: %s\n",$contact->Type,$contact->Phone; $record .= sprintf "%sEmail: %s\n",$contact->Type,$contact->Email; } return $record; }
sub AUTOLOAD { my $self = shift; my $name = $AUTOLOAD; $name =~ s/.*://; return if $name eq 'DESTROY'; if ($name !~ /^_/ && exists $self->{$name}) { if (@_) { return $self->{$name} = shift; } else { return $self->{$name}; } } croak "Undefined subroutine \&$AUTOLOAD called"; }
1; __END__