Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Improving if statements

by Bloodnok (Vicar)
on Sep 19, 2014 at 08:13 UTC ( #1101167=note: print w/replies, xml ) Need Help??


in reply to Improving if statements

TIMTOWTDI, if order matters, as it tends to in a test (.t file), I frequently use something along the lines of ...
# Defaine default my $change = "neutral"; my @lookup = ( { test => "blue" }, { dark => "black" }, { white => "light" }, { house => "home" }, { all\ things => "multi" }, { money => "value" }, { country => "USA" }, ); while (my ($i, $c) = each %lookup) { next unless $item eq $i; $change = $c; last; }
A purely untested suggestion ...

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://1101167]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-01-23 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?