Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Match all Odd and Even Numbers

by bimleshsharma (Beadle)
on Oct 12, 2012 at 06:27 UTC ( #998609=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Match all Odd and Even Numbers
in thread Match all Odd and Even Numbers

Do you mind to use below code

my $num= [1 .. 100]; my (@even,@odd); map{0==$_%2 ? push(@odd,$_):push(@even,$_)} @$num; print "@even and @odd";


Comment on Re^3: Match all Odd and Even Numbers
Download Code
Replies are listed 'Best First'.
Re^4: Match all Odd and Even Numbers
by Anonymous Monk on Oct 12, 2012 at 06:30 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (15)
As of 2015-07-07 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls