in reply to Simplifying for loop and applying multiple push function

or a sneeky version:

--$| ? push @one, $_ : push @two, $_ foreach %hash;

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Simplifying for loop and applying multiple push function
by duff (Parson) on Dec 14, 2005 at 22:05 UTC

    If you were going to be sneaky about it, surely you'd write it like so:

    push @{--$| ? \@one : \@two}, $_ for %hash;

    P.S. Is there some unspoken mission to use --$| for everything?