Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Match all Odd and Even Numbers

by Bilbo (Pilgrim)
on Jun 17, 2003 at 13:01 UTC ( [id://266454]=note: print w/replies, xml ) Need Help??


in reply to Match all Odd and Even Numbers

What you have written is

foreach (@nums){ push (@even, $_) if /\/2/; #match strings that contain '/2' push (@odd, $_) if /^\/2/; #match strings that start '/2' }

Try looking at the % (modulo) operator.Server Error (Error ID 427515c2136032)

An error has occurred. The site administrators have been notified of the problem and will likely soon fix it. We thank you, for you're patients.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-03-29 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found