But this solution might not be the fastest one :-)my @sortedKeys = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, join("", # xx.XXX.xx.X => xxxXXXxxxXXX map { sprintf("%03d", $_) } ( /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ ) ) ] } keys %hash;
In reply to Re: Sorting a hash of IP addresses?
by strat
in thread Sorting a hash of IP addresses?
by mnperez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |