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