http://qs321.pair.com?node_id=431729


in reply to sorting ip octets

A rather late reply, posted only to demonstrate TIMTOWTDI.

{ my $x; @ips = map { $_->[0] } sort { $x=0; $x = $a->[$_] - $b->[$_] and last for (1 .. 4); $x; } map { [ $_, split /[.]/ ] } @ips; }