in reply to Appropriately assigning times to variables
I'd probably select Time::Local there. There's a gotcha or two to lookout for though.
my ($S, $M) = (0,0); my $H = $1 if $hour =~ m/0*(\d+)/; # I'm not sure if leading 0s hurt my $d = $1 if $day =~ m/0*(\d+)/; my $m = $1 if $month =~ m/0*(\d+)/; $m --; # gotcha! the month is 0-11 # timelocal($sec,$min,$hour,$mday,$mon,$year); my $utime = timelocal($S, $M, $H, $d, $m, $year);
Although, in general, Date::Manip is the way to go, timelocal is a million times faster.
-Paul
|
|---|