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 drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-05-01 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found