X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FNet%2Fhostent.pm;h=04cbee35a7cea5da11596f10991cafe7dd5508b4;hb=3226bbec67a495e52de65a4d7ece19d720e5f94d;hp=1eeaae3393ae4fbf45237fcf81dd870db2196965;hpb=36477c247f3c188fb8cc7e276c87b739d3e6ab7c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Net/hostent.pm b/lib/Net/hostent.pm index 1eeaae3..04cbee3 100644 --- a/lib/Net/hostent.pm +++ b/lib/Net/hostent.pm @@ -1,10 +1,11 @@ package Net::hostent; use strict; +use 5.006_001; +our $VERSION = '1.00'; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - @ISA = qw(Exporter); @EXPORT = qw(gethostbyname gethostbyaddr gethost); @EXPORT_OK = qw( $h_name @h_aliases @@ -15,7 +16,10 @@ BEGIN { } use vars @EXPORT_OK; -use Class::Template qw(struct); +# Class::Struct forbids use of @ISA +sub import { goto &Exporter::import } + +use Class::Struct qw(struct); struct 'Net::hostent' => [ name => '$', aliases => '@', @@ -74,9 +78,9 @@ This module's default exports override the core gethostbyname() and gethostbyaddr() functions, replacing them with versions that return "Net::hostent" objects. This object has methods that return the similarly named structure field name from the C's hostent structure from F; -namely name, aliases, addrtype, length, and addresses. The aliases and -addresses methods return array reference, the rest scalars. The addr -method is equivalent to the zeroth element in the addresses array +namely name, aliases, addrtype, length, and addr_list. The aliases and +addr_list methods return array reference, the rest scalars. The addr +method is equivalent to the zeroth element in the addr_list array reference. You may also import all the structure fields directly into your namespace @@ -87,7 +91,7 @@ $h_name if you import the fields. Array references are available as regular array variables, so for example C<@{ $host_obj-Ealiases() }> would be simply @h_aliases. -The gethost() funtion is a simple front-end that forwards a numeric +The gethost() function is a simple front-end that forwards a numeric argument to gethostbyaddr() by way of Socket::inet_aton, and the rest to gethostbyname(). @@ -139,7 +143,7 @@ via the C pseudo-package. =head1 NOTE -While this class is currently implemented using the Class::Template +While this class is currently implemented using the Class::Struct module to build a struct-like class, you shouldn't rely upon this. =head1 AUTHOR