Trying to do completly stupid stuff with perl I tried to do the
following:
xyzzy% perl -le 'sort {print a:$a\tb:$b; $a cmp $b} qw(5 2 3 4 1)'
xyzzy%
Somehow the print statement isn't evaled. Playing a little more around
I tried the following:
xyzzy% perl -le '(sort {print a:$a\tb:$b; $a cmp
Peter Makholm [EMAIL PROTECTED] writes:
I have yet to find a usefull purpose for having side effects in the
sort statement but that is not the point here.
Having sort changing algorithm when the length of the array exceeds 7
probally makes it a lot harder to exploit. Now I really want to
On Sun, Mar 03, 2002 at 03:27:57PM +0100, Peter Makholm wrote:
Trying to do completly stupid stuff with perl I tried to do the
following:
xyzzy% perl -le 'sort {print a:$a\tb:$b; $a cmp $b} qw(5 2 3 4 1)'
xyzzy%
$ perl -wle 'sort {print a:$a\tb:$b; $a cmp $b} qw(5 2 3 4 1)'
Useless use of
PS With a truly lazy sort you'd be able to do...
($first) = sort { $a wibble $b } @big_list; # in O(n) time.
--
Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/
Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One
Some like elmers glue
but it
On Sat, 2 Mar 2002, Yanick wrote:
Ah, the things one is ready to do to keep his mind away from
a big fat score of 65 that doesn't seem to want to shrink of a
single stroke
Stephen Turner schreef op 3 marchi 2002:
If only there were a POSIX::secretnumber()
I checked that too; we
[EMAIL PROTECTED] wrote:
Unfortunately, I have been reduced to hanging on to Keith and
Stephen like a leech. :-(
Looks like the leech has detached itself. You've shot up to
second place, 5 strokes ahead of me. I don't seem to be
getting the epiphany yet, so I guess I've got a few days of
[EMAIL PROTECTED] wrote:
Unfortunately, I have been reduced to hanging on to Keith and
Stephen like a leech. :-(
Keith C. Ivey schreef op 4 Marchi 2002:
Looks like the leech has detached itself. You've shot up to
second place, 5 strokes ahead of me. I don't seem to be
getting the