http://www.perlmonks.org?node_id=976713


in reply to Perl Number range lookup question

#!/usr/bin/perl my $x = 40; my $tier; sub get_tier { my $x = shift; my $t = 0; $t += ($x > $_) for (@_); return $t; } $tier = get_tier($x, 9,19,29,39) if ($x >= 0 and $x < 50); $tier = get_tier($x, 59,69,79,89) if ($x >= 50 and $x < 100); print $tier, $/;
-sauoq
"My two cents aren't worth a dime.";