in reply to Abusing sort()

This only works for me on perls >= 5.8.0.

Replies are listed 'Best First'.
Re^2: Abusing sort()
by phroggy (Monk) on Jul 12, 2005 at 01:39 UTC

    Hmm, yeah, I'm seeing the same problem on perl 5.6.1; I had only tested this on 5.8.6. Apparently sort() works differently in 5.8.

    This works on 5.6.1:

    perl -e'$_=sprintf("%08b"x12,map hex,"194E8E91CC3A0097991C0350"=~/../g);print sort{(1+chop)*2-3}split"","Puht r arJtel\ncerae on,khs";'