How about this?
Shamelessly stolen from IP Manipulation: An Exercise# converts decimal dotted quad string to network ordered long sub dottedquad2long { return unpack('N', inet_aton(shift)); # or # return unpack 'N', pack 'C4', split /\./, shift; # or # my @seg = split(/\./, shift); # return $seg[0]*256**3+$seg[1]*256**2+$seg[2]*256+$seg[3]; }
--
Cheers, Joe
In reply to Re: inet_aton
by joe++
in thread inet_aton
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |