in reply to Sorting @lines

@sortedlines = map{(split)[1]} sort map{sprintf"%09d%09d%s%s %s",(split/\./)[0..3],$_} @lines;

Replies are listed 'Best First'.
Re2: Sorting @lines
by blakem (Monsignor) on Oct 11, 2002 at 02:54 UTC
    That will break if any of the elements have spaces in them. Probably not very likely, but a safer way to write a GRT is:
    my @sorted = map{(split(/\0/))[1]} sort map{sprintf"%09d%09d%s%s\0%s",(split/\./)[0..3],$_} @lines;

    -Blake