http://qs321.pair.com?node_id=697059


in reply to Re: Date manipulation
in thread Date manipulation

If you've got it, you could use the groovy "named capture" feature of Perl 5.10 to change that regex to:
$str_date =~ /^\w*\s*\w*\s*(?<month>\w*)\s*(?<day>\d*).*(?<year>\d +{4})$/;
and then the usage to:
my $date = sprintf("%4d%02d%02d", $+{year}, $months{$+{month}}, $+ +{day});

Replies are listed 'Best First'.
Re^3: Date manipulation
by olus (Curate) on Jul 11, 2008 at 20:58 UTC

    Thank you for the suggestion.