Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Regexp Epiphany

by Sigmund (Pilgrim)
on Aug 22, 2004 at 16:38 UTC ( [id://384946]=note: print w/replies, xml ) Need Help??


in reply to Re: Regexp Epiphany
in thread Regex Epiphany

oh, it actually doesn't matter.
I can safely remove AM or PM and it all works ok!

Replies are listed 'Best First'.
Re^3: Regexp Epiphany
by Aristotle (Chancellor) on Aug 22, 2004 at 17:56 UTC

    How can it? You lose information. That strings contains nothing else that would indicate whether the times are AM or PM. Date::Manip is probably assuming 24-hour-time, effectively assuming AM for all times.

    Did you actually test your assumption or are you simply programming by coincidence?

    $ perl -MDate::Manip -le'print UnixDate "Wed, 28 Jul 2004 9:12 PM", "% +s"' 1091041920 $ perl -MDate::Manip -le'print UnixDate "Wed, 28 Jul 2004 9:12", "%s"' 1090998720

    You didn't notice that, because you're not asking for the time, only for the date. Are you sure you will never want to see the time, in a future change to the script? Will you remember this idiosyncracy of your solution at the time? You should at least document this issue in your script; the better approach would of course be to either strip the entire time out of the string completely (Date::Manip will assume 12AM sharp) or not to destroy this information in the first place.

    Makeshifts last the longest.

      but i don't mind at all...
      my files will be like this:

      sender040822.html

      and the date isn't an important issue.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-04-23 13:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found