.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::Whois::RIPE::Object 3pm" .TH Net::Whois::RIPE::Object 3pm "2006-04-17" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Whois::RIPE::Object \- RIPE Query Results .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::Whois::RIPE::Object; \& \& \& $object = new Net::Whois::RIPE::Object; \& $object\->debug(1); \& \& \& while ($line = $whois_socket\->get()) { \& ($attribute,$value) = ($line =~ /^(.+?):\es+(.+)$/); \& next unless $attribute; \& $object\->add($attribute,$value); \& } \& \& $object\->success || die; \& \& foreach $attribute ($object\->attributes()) { \& foreach $value ($object\->$attribute()) { \& printf "%s: %\-s\en", $attribute, $value; \& } \& } \& \& print $object\->content; # raw content from whois server \& \& for $error ($object\->error) {...} \& for $warn ($object\->warning) {...} .Ve .SH "DESCRIPTION" .IX Header "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. .PP These objects are created by \fINet::Whois::RIPE\fR to be returned as \fIquery\fR results. .PP Short background...a \fBwhois\fR server would return the following for a person query. .PP .Vb 12 \& 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: APNIC .Ve .PP \&\fINet::Whois::RIPE::Object\fR parses the attribute's and values and \fBadd\fR's them to itself. The \s-1RIPE\s0 object can then be used to access the attribute values using the attribute names as methods. A call to \fBattributes\fR returns an ordered list of all attributes parsed. .PP 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 \fBcontent\fR method may provide output from the server that can be used to diagnose why. .PP .Vb 2 \& $whois = Net::Whois::RIPE\->new($host); \& $query = $whois\->query(\*(AqPaul Gampe\*(Aq); \& \& unless ($query\->success) { \& print "There\*(Aqs been a problem...server response is...\en"; \& print $query\->content; \& exit \& } \& \& print "Paul\*(Aqs nic\-hdl is ", $query\->nic_hdl, "\en"; .Ve .PP Attributes that had a dash '\-' are converted to underscore '_' for method names. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .IP "\fBnew(\s-1HANDLE\s0)\fR" 4 .IX Item "new(HANDLE)" Creates a new \s-1RIPE\s0 object. Attempts to parse lines from \fI\s-1HANDLE\s0\fR. Any parsing failure causes the constructor to return undef. Error messages are available via \fBerrstr\fR. \fI\s-1HANDLE\s0\fR may be a file handle or a socket. .SH "METHODS" .IX Header "METHODS" .IP "\fB\f(BIcontent()\fB\fR" 4 .IX Item "content()" Returns the raw output from the whois server. In a list context it returns the lines from whois as a list. In a scalar context it returns the entire list in a scalar. .Sp In the case where no \s-1ATTRIBUTE\s0's are available via the \fBattributes\fR method, then the content may hold information from \fIwhois\fR as to why. .IP "\fB\f(BIattributes()\fB\fR" 4 .IX Item "attributes()" Returns the list of \s-1ATTRIBUTE\s0's that were added by \fBadd\fR. The order of the list is the order the \s-1ATTRIBUTE\s0's were added in. .Sp If no \s-1ATTRIBUTE\s0's were added then an empty list is returned. Try calling \&\fBcontent\fR to obtain output from the \fIwhois\fR server as to why. .Sp Call \fIattributes\fR to find out if the object was successfully parsed. \&\fIsuccess\fR reports errors from the whois server. It is possible that \&\fIsuccess\fR can report true but the object has no attributes. .IP "\fB\f(BIwarning()\fB\fR" 4 .IX Item "warning()" In a list context it returns an array of warning lines. In a scalar context it returns a \en separated string of warning lines. .Sp These are the warnings from the whois server about the object. .IP "\fB\f(BIerror()\fB\fR" 4 .IX Item "error()" In a list context it returns an array of error lines. In a scalar context it returns a \en separated string of error lines. .Sp These are the errors from the whois server about the object. .IP "\fBsuccess\fR" 4 .IX Item "success" Returns 1 if no errors defined, 0 otherwise .IP "\fBdebug(\s-1LEVEL\s0)\fR" 4 .IX Item "debug(LEVEL)" Sets/gets the debug level. .SH "CAVEATS" .IX Header "CAVEATS" .SH "AUTHOR" .IX Header "AUTHOR" .Vb 3 \& Kevin Baker, \& Paul Gampe, \& Bruce Campbell, .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& Net::Whois::RIPE .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 2 \& Copyright (C) 1999 Paul Gampe and APNIC Pty. Ltd. \& Copyright (C) 2000 Kevin Baker and APNIC Pty. Ltd. \& \& This program is free software; you can redistribute it and/or modify \& it under the terms of the GNU General Public License as published by \& the Free Software Foundation; either version 1, or (at your option) \& any later version. \& \& This program is distributed in the hope that it will be useful, \& but WITHOUT ANY WARRANTY; without even the implied warranty of \& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \& GNU General Public License for more details. \& \& You should have received a copy of the GNU General Public License \& along with this program; if not, write to the Free Software \& Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .Ve .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 82:" 4 .IX Item "Around line 82:" \&'=item' outside of any '=over' .IP "Around line 88:" 4 .IX Item "Around line 88:" You forgot a '=back' before '=head1' .IP "Around line 90:" 4 .IX Item "Around line 90:" \&'=item' outside of any '=over' .IP "Around line 133:" 4 .IX Item "Around line 133:" You forgot a '=back' before '=head1'