Simon Cozens wrote:
> With all due respect, that's not been my experience. Even beginners know
> how to do things like "length", by far the most common case for the ST.

You must be kidding.  Sorting a list of strings by length is more
common that, say, sorting them numerically by some embedded number?
I don't think so.

Besides, simply sorting strings by length doesn't require ST.
The ST applies when you want to sort by one or more embedded "fields".

So, sorting by length of an embedded field is the most common case?
I can honestly say that I have never done this, seen it, recommended
it, or seen it recommended (though I admit it must come up from time
to time):
        map { $_->[0] }
        sort { $a->[1] <=> $b->[1] }
        map { my($s) = /X(.*?)Y/; [ $_, length($s) ] }
        @items

-- 
John Porter

Useless use of time in void context.

Reply via email to