Net::Whois::RIPE::Object

RIPE Query Results
Download

Net::Whois::RIPE::Object Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Kevin Baker, Paul Gampe and Bruce Campbell
  • Publisher web site:
  • http://search.cpan.org/~paulg/

Net::Whois::RIPE::Object Tags


Net::Whois::RIPE::Object Description

RIPE Query Results Net::Whois::RIPE::Object is a Perl module with RIPE query results.SYNOPSIS use Net::Whois::RIPE::Object; $object = new Net::Whois::RIPE::Object; $object->debug(1); while ($line = $whois_socket->get()) { ($attribute,$value) = ($line =~ /^(.+?):s+(.+)$/); next unless $attribute; $object->add($attribute,$value); } $object->success || die; foreach $attribute ($object->attributes()) { foreach $value ($object->$attribute()) { printf "%s: %-s ", $attribute, $value; } } print $object->content; # raw content from whois server for $error ($object->error) {...} for $warn ($object->warning) {...}DESCRIPTION ^Encapsulates the results of a whois query. The attribute/value pairs of the response may then by accessed using the attribute as a method name.These objects are created by Net::Whois::RIPE to be returned as query results.Short background...a whois server would return the following for a person query. person: Paul Gampe address: Level 1 - 33 Park Road address: Milton, QLD, 4064 country: AU phone: +61-7-3367-0490 fax-no: +61-7-3367-0482 e-mail: paulg@apnic.net nic-hdl: PG6-AP remarks: APNIC Technical Operations Team mnt-by: MAINT-AP-APNIC-TECH changed: paulg@apnic.net 19990909 source: APNICNet::Whois::RIPE::Object parses the attribute's and values and add's them to itself. The RIPE object can then be used to access the attribute values using the attribute names as methods. A call to attributes returns an ordered list of all attributes parsed.All values are stored as lists since some attributes are multiline (e.g. address). If there has been a problem with the query then the content method may provide output from the server that can be used to diagnose why. $whois = Net::Whois::RIPE->new($host); $query = $whois->query('Paul Gampe'); unless ($query->success) { print "There's been a problem...server response is... "; print $query->content; exit } print "Paul's nic-hdl is ", $query->nic_hdl, " ";Attributes that had a dash '-' are converted to underscore '_' for method names. Requirements: · Perl


Net::Whois::RIPE::Object Related Software