Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: while loop with logical or

by Util (Priest)
on Dec 19, 2011 at 22:29 UTC ( [id://944313]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Interleaved order
    while ( /($a|$d)/g ) {
        print "$1\n";
    }
    
  2. or download this
    # Original order. Note that $1 is now $_.
    for ( /($a)/g, /($d)/g ) {
        print "$_\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found