use strict; use Date::Manip; &Date_Init("PersonalCNF=holidays.cnf","TZ=PST8PDT"); my $now = &ParseDate("now"); my $date = &ParseDate($ARGV[0]); $date = &Date_NextWorkDay(&ParseDate($date),0) unless $ARGV[1]; # Anything past the first argument acts as an "override" print &UnixDate($date,"Sleeping until %T on %F.\n"); my $delta = &DateCalc($now,$date); my $secs = &Delta_Format($delta,0,"%sh"); if ($secs < 0) { print "Hey, that's in the past--you can't fool me!\n"; exit; } print "(that's $secs seconds...)\n"; sleep $secs;