in reply to Simple typo in numerical sort, major error

print join(",",sort { $a => $b} @a);
produces an even weirder order. You'll also love
if ($x = $y) { ... }

Replies are listed 'Best First'.
Re^2: Simple typo in numerical sort, major error
by AnomalousMonk (Archbishop) on Dec 31, 2009 at 21:25 UTC

    Less common, but always amusing:

    >perl -wMstrict -le "my ($x, $y) = (0, 0); if ($x =! $y) { print 'Huh?!?' } if ($x) { print 'What the...' } " Huh?!? What the...

    I almost lost my mind one night over a C code mal-expression like that. Now I always set the compiler to exclude or warn about assignment in conditionals if possible, or fall back on the
        #define is   ==
        #define isnt !=
    hack if not, or both.