Tags: perl5 Ähnliche Threads
1234
@ar = [ "g12.t2", "g779.t4", "g88.t4", "g12.t13" ]
@ar_sorted = [ "g12.t2", "g12.t13", "g88.t4", "g779.t4" ]
1 2 3 4 5 6 7
my @sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1] || $a->[2] <=> $b->[2] } map { [$_, m/^g(\d+)\.t(\d+)$/] } @ar;