in reply to Nested testing of many conditions--a better way?
sub is_day_ok { my $day = shift; return if $today <= $start; return if $today >= $stop; # Continue as necessary return 1; } if (is_day_ok($today)) { print "$today is the day\n"; } else { print "Nevermind.\n" }
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
|
|---|