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

Re^2: switch, transliteration ( tr/// ) of $_ issue

by blazar (Canon)
on Nov 19, 2008 at 11:40 UTC ( #724554=note: print w/replies, xml ) Need Help??

in reply to Re: switch, transliteration ( tr/// ) of $_ issue
in thread switch, transliteration ( tr/// ) of $_ issue

No real advantage, but for completeness:

my ($bar) = map +(0,'low','med','high')[tr/I//] || 'drat', $foo; # or my ($bar) = map qw(0 low med high)[tr/I//] || 'drat', $foo;

qw helps, and "0" is false...

If you can't understand the incipit, then please check the IPB Campaign.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2016-10-24 23:50 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (312 votes). Check out past polls.