in reply to Testing for 16 possible combinations with 4 pull-down menus

Use a hash as a state table.

You'll have to fill in how you get your 0s and 1s and concatenate them, and getting your times into comparable format (seconds since...).

#! perl -slw use strict; my %states = ( 0000 => 1, 0001 => 0, 0010 => 0, 0011 => 0, 0100 => 0, 0101 => 0, 0110 => 0, 0111 => 0, 1000 => 1, 1001 => 0, 1010 => 1, 1011 => 0, 1100 => 1, 1101 => 0, 1110 => 0, 1111 => 1, ); my $state = ....; ## Get state from wherever? if( $states{ $state } ) { ## Validate values my( $startTime, $endTime ) = ...; ## Get times if( $startTime < $endTime ) { ## Do it } else { ## Reject. } else { ## Reject. }

BTB. If specifying just start and end hour is valid, why isn't specifying start hr/min and just end hr (1110) also valid? Eg. Start:10:45 * End: 11


Examine what is said, not who speaks.        The end of an era!
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon