Sorting IP addresses 

use Socket;

my @sorted =
    map { inet_ntoa $_ }
    sort
    map { inet_aton $_ } @addr;