if (season($start_date) && season($end_date) { $season_days = Delta_Days($start_date, $end_date) } elsif season($start_date) {
try not to make it *more* complicated :)
You posted your own answer in the first post.
Consider:
((season($start_date) && (season($end_date)) ? go sub for $80 : or go sub for $55;
Or however you want to test for Summer.
Me, Im crazy -
# What you are trying, you don't neend a module: my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime;
# Then - my $vdate = sprintf("%02d", $mon + 1) . '/' . sprintf("%02d", $mday); $vdate .= '/' . ($year += 1900);
# Year doesn't matter; my $xdate = sprintf("%02d", $mon + 1) . sprintf("%02d", $mday);
print "Today is $vdate and our target is $xdate\n\n";
# are we inside Summer?
my $start = 701; my $end = 915;
(($xdate >= $start) && ($xdate <= $end)) ? print "\$80 Woohooo\n\n" : print "\$55 isn't too shabby\n\n";
# Fake Summer - $xdate = 801;
(($xdate >= $start) && ($xdate <= $end)) ? print "\$80 Woohooo\n\n" : print "\$55 isn't too shabby\n\n";
__END__
Cheers! -- _Sx_ http://youve-reached-the.endoftheinternet.org/ _____ http://jaxpm.insecurity.org/ http://cis4dl.insecurity.org/
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>