[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Complex sort(?)



On Fri, Sep 03, 1999 at 02:22:19PM -0700, Bruce Van Allen wrote:
> Except, of course, that one otherwise very useful example in the 
> first referenced site appears to have an extra left parenthesis:
> 
> perlfaq4.html#How_do_I_sort_an_array_by_anyth says:
> ...
> Which could also be written this way, using a trick that's come to be 
> known as the Schwartzian Transform:
> 
>        @sorted = map  { $_->[0] }
>                  sort { $a->[1] cmp $b->[1] }
>                  map  { [ $_, uc((/\d+\s*(\S+)/ )[0] ] } @data;
>                                 ^
>                               oops!
> 

Nope, it's a missing right parenthesis.

                 map  { [ $_, uc((/\d+\s*(\S+)/ )[0] ] } @data;
                                                    ^
                                                  oops!

Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org