in reply to Testing for 16 possible combinations with 4 pull-down menus
Screams lookup table to me ...
sub validate { return ($_[0] < $_[1]) } %lookup = { '0000' => &validate($start,$end), '0001' => false, '0010' => false, . . . '1111' => &validate($start,$end) }; . . . if ($lookup{$switch_binary}) { # Result is valid } else { # Call user a pudding-head }
|
|---|