Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Simplifying for loop and applying multiple push function

by qq (Hermit)
on Dec 14, 2005 at 22:09 UTC ( #516785=note: print w/ replies, xml ) Need Help??


in reply to Simplifying for loop and applying multiple push function

my %hash = ( 1 => 'one' , 2 => 'two' , 3 => 'three' ); no strict; map { push @{ ++$i % 2 ? 'one' : 'two'}, $_ } %hash; print "@one\n"; print "@two\n";

Another one-line attempt. But maybe it should count as two...


Comment on Re: Simplifying for loop and applying multiple push function
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-09-01 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (7 votes), past polls