##
my @sorted = sort {
my @a = $a =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
my @b = $b =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
$a[0] <=> $b[0] ||
$a[1] <=> $b[1] ||
$a[2] <=> $b[2] ||
$a[3] <=> $b[3]
} @unsorted;
##
##
my @sorted = sort {
pack('C4' => $a =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/)
cmp
pack('C4' => $b =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/)
} @unsorted;