Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Date manipulation

by shoness (Friar)
on Jul 11, 2008 at 19:11 UTC ( #697059=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://697059]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2020-10-29 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (269 votes). Check out past polls.

    Notices?