in reply to Re: The High Price of Golf, and A Surprise
in thread The High Price of Golf, and A Surprise
So far it looks as though B::Deparse is broken.$ perl -MO=Deparse,x7 -e'sort { $a cmp $b } @x' sort @x; -e syntax OK $ perl -MO=Deparse,x7 -e'sort { $b cmp $a } @x' sort @x; -e syntax OK $ perl -MO=Deparse,x7 -e'sort { $a <=> $b } @x' sort @x; -e syntax OK $ perl -MO=Deparse,x7 -e'sort { $b <=> $a } @x' sort @x; -e syntax OK
Obviously, it is not. Looks rather like Perl has builtins for all the common cases, then.$ perl -MO=Deparse,x7 -e'sort { $a->[0] cmp $b->[0] } @x' sort {$$a[0] cmp $$b[0];} @x; -e syntax OK
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re*Re^2: The High Price of Golf, and A Surprise
by bart (Canon) on Sep 07, 2002 at 11:45 UTC | |
by Aristotle (Chancellor) on Sep 07, 2002 at 11:53 UTC | |
by hv (Prior) on Mar 04, 2003 at 00:27 UTC | |
|
Re:x3 The High Price of Golf, and A Surprise
by grinder (Bishop) on Sep 07, 2002 at 21:15 UTC | |
|
Re: Re^2: The High Price of Golf, and A Surprise
by broquaint (Abbot) on Sep 07, 2002 at 17:04 UTC | |
by Aristotle (Chancellor) on Sep 07, 2002 at 18:27 UTC |