Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Conditional Operator Confusion

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


in reply to Conditional Operator Confusion

You may like:

for(1..10){ $x= $_ > 5 && 'foo' || 'bar'; print "$_:$x\n"; }

instead. Update: You may like:

print"$_:${[$_>5&&'foo'||'bar']}[0]\n"for 1..10;

even better.


DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586677]
help
Chatterbox?
[stevieb]: Corion: the problem with that is the 2.36 represents the underlying C library I've wrapped, which is why I want to use incrementals after the real version number. I've emailed modules@ to see if they can expedite the process for me...
[stevieb]: ...as normally, it takes three days to delete, in case you want to change your mind

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-01-19 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (170 votes). Check out past polls.