Net::Whois::ARIN::Contact - ARIN whois Contact record class


Net-Whois-ARIN documentation Contained in the Net-Whois-ARIN distribution.

Index


Code Index:

NAME

Top

Net::Whois::ARIN::Contact - ARIN whois Contact record class

SYNOPSIS

Top

  use Net::Whois::ARIN::Contact;

  my $poc = Net::Whois::ARIN::Contact->new(
               Name       => 'Caine, Todd',
               Handle     => 'TCA53-ARIN',
               Company    => 'Electric Lightwave',
               Address    => '4400 NE 77th Ave',
               City       => 'Vancouver',
               StateProv  => 'WA',
               PostalCode => '98662',
               Country    => 'US',
               Comment    => '',
               RegDate    => '1995-07-25',
               Updated    => '2001-05-17',
               Phone      => '503-555-1212',
               Email      => 'nobody@nobody.net',
           );

  printf "The ARIN contact handle for %s is %s.\n",
         $poc->Name,
         $poc->Handle;

DESCRIPTION

Top

The Net::Whois::ARIN::Contact module is simple class which is used to store the attributes of a point-of-contact record in ARIN's Whois server. Each attribute of the contact record has an accessor/mutator of the same name.

METHODS

Top

new - create a Net::Whois::ARIN::Contact object
dump - return the current whois record
  print $o->dump;

ATTRIBUTES

Top

These methods are the accessors/mutators for the fields found in the Whois record.

Type - get/set the contact type
Name - get/set the contact name
Handle - get/set the contact handle
Company - get/set the company
Address - get/set the address
City - get/set the city
StateProv - get/set the state or province
PostalCode - get/set the postal code
Country - get/set the country
RegDate - get/set the registration date
Updated - get/set the last updated date
Phone - get/set the contact phone number
Email - get/set the contact email address
Comment - get/set the public comment

AUTHOR

Top

Todd Caine <todd.caine at gmail.com>

COPYRIGHT AND LICENSE

Top


Net-Whois-ARIN documentation Contained in the Net-Whois-ARIN distribution.
package Net::Whois::ARIN::Contact;

use strict;
use Carp "croak";

our $AUTOLOAD;

sub new {
    my $class = shift;
    return bless { @_ }, $class;
}

sub dump {
    my $self = shift;
    my $record = sprintf "\nName:       %s\n",$self->Name;
    $record .= sprintf "Handle:     %s\n",$self->Handle;
    $record .= sprintf "Company:    %s\n",$self->Company;
    $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 "Comment:    %s\n",$self->Comment;
    $record .= sprintf "RegDate:    %s\n",$self->RegDate;
    $record .= sprintf "Updated:    %s\n",$self->Updated;
    $record .= sprintf "Phone:      %s\n",$self->Phone;
    $record .= sprintf "Email:      %s\n",$self->Email;
    return $record;
}

sub Type {
    my $self = shift;
    $self->{Type} = shift if @_;
    return $self->{Type};
}

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__