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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586677]
[Discipulus]: Eily this percentage get higher everyday i suppose
Discipulus sometimes i'm here alone with you, bony brother
[Discipulus]: ok a Perl one: how approach the task of getting all distinct paths from the edge to a node of a pascal triangle (nobackwards)?
[Discipulus]: each node has 2 descendants only: can i just compose hash keys usinng coords?
[karlgoethebier]: Discipulus: you shouldn't smoke turkish spices before noon

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2018-03-19 10:53 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.