Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by Bloodnok (Vicar)
on Nov 18, 2008 at 16:31 UTC ( [id://724318]=note: print w/replies, xml ) Need Help??


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

... or the poor mans' equivalent of a switch...
SWITCH: { $foo =~ tr/I/I/ == 1 && do { $bar = 'low'; last SWITCH; }; $foo =~ tr/I/I/ == 2 && do { $bar = 'med'; last SWITCH; }; $foo =~ tr/I/I/ == 3 && do { $bar = 'high'; last SWITCH; }; $bar = "drat"; }
construct.

Update Corrected typos...

  • ~= should, of course, be =~
  • Extraneous )

A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-24 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found