Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Re: help on getting date

by boo_radley (Parson)
on Jun 02, 2003 at 19:33 UTC ( #262467=note: print w/replies, xml ) Need Help??


in reply to Re: Re: help on getting date
in thread help on getting date

why bother with the temporary variables, especially inside map? Heck, you'd also screen out a small subset of invalid data.
print  map {$_ =~ /(\d\d)-(\d\d)-(\d{4})/ && "$3-$1-$2"; } ("01-02-1999");
of course, using this kind of code, you'd need to make sure that your dataset's valid -- you won't get Date::Manip's heavy duty "Am I valid datetime or not" routines.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://262467]
help
Chatterbox?
marto waves
[karlgoethebier]: hello jedikaiti! something shiny tonight?
[jedikaiti]: It's a very pretty shiney
[jedikaiti]: Shiney!
[karlgoethebier]: very nice!
[shmem]: hm. Can't resolve apod.nasa.gov - weird.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-11-21 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (308 votes). Check out past polls.

    Notices?