Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: d-mmm-yyyy to DOY (day of year)

by sundialsvc4 (Abbot)
on May 14, 2013 at 13:53 UTC ( #1033467=note: print w/replies, xml ) Need Help??

in reply to d-mmm-yyyy to DOY (day of year)

Also, if you do find that you need to “install something” in order to address your problem ... by all means, stop and “look for a Plan-B.”   There are many date-manipulation packages in Perl ... literally, hundreds of them.   Something is already going to be installed, that you can use to get this job done.   See for example perldoc perllocal.   You don’t need to smash down this particular door, to get to where you need to be, given such a simple requirement.

Here’s a handy one-liner:   perl -e 'use Date::Manip;' ... enter that on the shell command-line exactly as shown.   If that command succeeds (no nasty messages spew out), then you know that this module Date::Manip in this case) is available on your system, so perldoc Date::Manip to learn how it works.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033467]
[Eily]: I just wrote a oneliner to solve a (non perl) colleague's problem, and it worked on the first try
[Eily]: and he wasn't impressed
1nickt adds gingersnaps to the platter on the sideboard.
[Eily]: sure it was a pretty standard one liner (of the $h{$1} = $2 if /regex/; END { pp \%h; } variety), but he's not supposed to know that!
[Eily]: what's the point of writing perl if people aren't impressed :P

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2017-04-26 15:00 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (482 votes). Check out past polls.