Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Simplifying for loop and applying multiple push function

by GrandFather (Saint)
on Dec 14, 2005 at 21:57 UTC ( [id://516781]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://516781]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-18 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found