Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by blazar (Canon)
on Nov 19, 2008 at 11:40 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-24 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found