Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Date manipulation

by shoness (Friar)
on Jul 11, 2008 at 19:11 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://697059]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found