- or download this
# given the string value in $_ ...
my @v = split m#/#;
unshift @v, shift(@v) =~ /^(.*?)(\d*)$/;
- or download this
sprintf "%-4s%3d%3d%3d", @v;
- or download this
map { $_->[1] }
sort { $_->[0] cmp $_->[1] }
...
no warnings; # in case @v has less than 4 elements
[ sprintf( "%-4s%3d%3d%3d", @v ), $_ ]
}