http://qs321.pair.com?node_id=1101167


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 :-))