Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Conditional Operator Confusion

by GrandFather (Sage)
on Nov 29, 2006 at 12:47 UTC ( #586677=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for(1..10){
      $x= $_ > 5 && 'foo' || 'bar';
      print "$_:$x\n";
    }
    
  2. or download this
    print"$_:${[$_>5&&'foo'||'bar']}[0]\n"for 1..10;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586677]
help
Chatterbox?
[Discipulus]: molex connectors? auto products must have lots of them

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-11-19 20:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (282 votes). Check out past polls.

    Notices?