IP-Adressen numerisch sortieren
In Perl:
my @sortedips = sort { (unpack"N",(pack"CCCC",(split/\./,$a))) <=> (unpack"N",(pack"CCCC",(split/\./,$b))) } @unsortedips;
In Perl:
my @sortedips = sort { (unpack"N",(pack"CCCC",(split/\./,$a))) <=> (unpack"N",(pack"CCCC",(split/\./,$b))) } @unsortedips;