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

Re: Conditional for statement block (not just bare statement)

by ikegami (Patriarch)
on Dec 16, 2008 at 20:32 UTC ( [id://730735]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    do{print "miney\n"; print "moh\n";} if $cond;
    
  2. or download this
    map{print "miney\n"; print "moh\n";} 1 if $cond;
    
  3. or download this
    grep{print "miney\n"; print "moh\n";} 1 if $cond;
    
  4. or download this
    sub{print "miney\n"; print "moh\n";}->() if $cond;
    
  5. or download this
    sub doif(&$) { $_[0]->() if $_[1] }
    doif{print "miney\n"; print "moh\n";} $cond;
    
  6. or download this
    print("miney\n"),print("moh\n") if $cond;
    
  7. or download this
    (print "miney\n"),(print "moh\n") if $cond;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found