>>>>> "PS" == Peter Scott <[EMAIL PROTECTED]> writes:
PS> I'm kinda puzzled by the focus on Schwartzian when I thought the
PS> GRT was demonstrated to be better. Anyway, all we need is a
PS> syntax for specifying an extraction function and whether the
PS> comparison is string or numeric. If the parser can be persuaded
PS> to accept an array ref instead of a block, how about
PS> sort [ '<=>' => \&f ] @t
how about multikey support? sort ordering (ascending, descending) which
is also per key, etc.
you could have a list of those pairs to deal with multikeys, but you
need a sort order flag somewhere.
but if that is all you have, you could do this with a simple module and
it doesn't have to be in the perl language. just loop over the list of
pairs (triplets?) and generate a map that calls each function which
builds up the list of keys with the original record in [0]. then build
up code that does a sequence of compares with $a->[$n], etc for each of
the keys. then eval the whole mess and pray. :)
and when using the GRT you need to know if the integers are
signed/unsigned if you pack them with the 'N' long format. if you use
sprintf, you need to know the maximum digit count of all the key
values. this is one win of the ST over the GRT, you don't need to know
as much about the key as perl will do the comparisons right with just
cmp and <=>. you still need sort order and multikey support. otherwise
you don't gain so much.
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com