ckdot has asked for the wisdom of the Perl Monks concerning the following question:
sub AddDate ( $ ) { my ( $datestr ) = @_; trim_whitespace ($datestr); my $DID; if ( !exists ( $hTempDates { $datestr })) { $DID = $nDate ++; $hDates { $DID }{ Date } = $datestr; $hTempDates { $datestr }{ ID } = $DID; } else { $DID = $hTempDates { $datestr }{ ID }; } return $DID; }
my $datestr; if ( $header =~ /(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(\ +w*)\s(\d\d),\s(\d\d\d\d)/s ) { my $monthstr = $1 . $2; my $day = $3; my $year = $4; my $month=$months{$monthstr}; $datestr = sprintf ( "%04d-%02d-%02d", $year, $month+1, $day ); } my $DID = main::AddDate ( $datestr );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: date problem with movie script
by matija (Priest) on Apr 16, 2004 at 05:38 UTC | |
by ckdot (Novice) on Apr 16, 2004 at 13:03 UTC | |
by matija (Priest) on Apr 16, 2004 at 16:28 UTC | |
by ckdot (Novice) on Apr 16, 2004 at 16:44 UTC | |
|
Re: date problem with movie script
by theguvnor (Chaplain) on Apr 16, 2004 at 18:17 UTC | |
by ckdot (Novice) on Apr 16, 2004 at 23:20 UTC | |
by chanio (Priest) on Apr 17, 2004 at 03:07 UTC | |
|
Re: date problem with movie script
by Anonymous Monk on May 07, 2004 at 18:56 UTC |