$network = $network * 256 + $_ foreach(split(/\./, $addr);
can be replaced with
$network = unpack('N', pack('C4', split(/\./, $addr)));
Better yet, use
use Socket qw( inet_aton );
$network = unpack('N', inet_aton($addr));
In reply to Re: String eval is cool
by ikegami
in thread String eval is cool
by DrHyde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |