in reply to String eval is cool

$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));