All pastes #45699 Raw Edit

Unnamed

public text v1 · immutable
#45699 ·published 2006-03-14 17:43 UTC
rendered paste body
#!/usr/bin/perl
use Net::IP;
my $ip = new Net::IP ($ARGV[0]) or die (Net::IP::Error());
print "In Binary: " . $ip->binip . "\n";
$decip= bin2dec($ip->binip);
print "DecIP:$decip\n";
sub bin2dec {
    return unpack("N", pack("B32", substr("0" x 32 . shift, -32)));
}