my @sorted=map $unsrt[ (split /:/)[-1] ], sort map func($unsrt[$_]) . ":$_", 0 .. $#unsrt;