fauria has asked for the wisdom of the Perl Monks concerning the following question:
use Net::IP qw(:PROC); my $ipaddr = '10.0.1.3'; my $ip = new Net::IP($ipaddr) or die (Net::IP::Error()); my $int = $ip->intip(); print "Integer value of IP $ipaddr: $int\n";
use Net::IP qw(:PROC); + + my $intaddr = 167772419; my $binaddr; eval{ $binaddr = ip_inttobin($intaddr); }; die "Error: $@" if($@); !defined($binaddr) and print "Binary not defined\n"; print "Binary value of integer $intaddr: $binaddr\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IP operation trouble
by gellyfish (Monsignor) on Jan 12, 2005 at 14:07 UTC | |
|
Re: IP operation trouble
by borisz (Canon) on Jan 12, 2005 at 14:16 UTC | |
|
Re: IP operation trouble
by naChoZ (Curate) on Jan 12, 2005 at 14:08 UTC | |
by fauria (Deacon) on Jan 12, 2005 at 14:27 UTC | |
|
Re: IP operation trouble
by DrHyde (Prior) on Jan 13, 2005 at 10:14 UTC |