X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FNet%2Fnetent.pm;h=f7d32cb92542fb56af875ccc8bf4825627f3a68f;hb=a93751fa40b15f424f91bba70d1533c6b4024e42;hp=fbc6d987fe5490fa80df1ecda4d679ec86043147;hpb=8dcee03ef4ed12141a63dec75da7d736915e7be4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Net/netent.pm b/lib/Net/netent.pm index fbc6d98..f7d32cb 100644 --- a/lib/Net/netent.pm +++ b/lib/Net/netent.pm @@ -1,9 +1,11 @@ package Net::netent; use strict; +use 5.006_001; +our $VERSION = '1.00'; +our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { use Exporter (); - use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS); @EXPORT = qw(getnetbyname getnetbyaddr getnet); @EXPORT_OK = qw( $n_name @n_aliases @@ -119,26 +121,26 @@ This seems a bug, but here's how to deal with it: use strict; use Socket; use Net::netent; - + @ARGV = ('loopback') unless @ARGV; - + my($n, $net); - + for $net ( @ARGV ) { - + unless ($n = getnetbyname($net)) { warn "$0: no such net: $net\n"; next; } - + printf "\n%s is %s%s\n", $net, lc($n->name) eq lc($net) ? "" : "*really* ", $n->name; - + print "\taliases are ", join(", ", @{$n->aliases}), "\n" if @{$n->aliases}; - + # this is stupid; first, why is this not in binary? # second, why am i going through these convolutions # to make it looks right @@ -147,7 +149,7 @@ This seems a bug, but here's how to deal with it: shift @a while @a && $a[0] == 0; printf "\taddr is %s [%d.%d.%d.%d]\n", $n->net, @a; } - + if ($n = getnetbyaddr($n->net)) { if (lc($n->name) ne lc($net)) { printf "\tThat addr reverses to net %s!\n", $n->name;