in reply to INET_NTOA Equivalent
sub to_dotquad { # Given a binary int IP, returns dotted-quad (Reverse of ip2num) my $bin = shift; my $result = ''; # Empty string for (24,16,8,0){ $result .= ($bin >> $_ & 255) . '.'; } chop $result; # Delete extra trailing dot return $result; }
By guaranteeing freedom of expression, the First Amendment also guarntees offense.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: INET_NTOA Equivalent
by atcroft (Abbot) on Apr 15, 2004 at 02:53 UTC |