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:
and then the usage to:$str_date =~ /^\w*\s*\w*\s*(?<month>\w*)\s*(?<day>\d*).*(?<year>\d +{4})$/;
my $date = sprintf("%4d%02d%02d", $+{year}, $months{$+{month}}, $+ +{day});
In Section
Seekers of Perl Wisdom