Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Run if weekend

by BillKSmith (Monsignor)
on Jun 14, 2016 at 18:22 UTC ( [id://1165627]=note: print w/replies, xml ) Need Help??


in reply to Re: Run if weekend
in thread Run if weekend

I had a perl script which I ran every day for several years. It had to form a URL which included the current date. The format was slightly different on Sunday. It made perfect sense to use localtime to get the date and day-of-week and to use strftime (FUNCTIONS) to format it.
Bill

Replies are listed 'Best First'.
Re^3: Run if weekend
by Your Mother (Archbishop) on Jun 14, 2016 at 18:58 UTC

    That's cromulent but, at least from the limited original description, quite different from the OP's problem; a script specifically to write temporal output versus a script only intended (for the time being at least) to run within a temporal window. The second is the sort of thing that is harder to debug and circumvent on demand as well. Taking date args in the invocation would be better than hardcoding the date in all invocations. So I say. :P

      I think that better than taking date args, taking behavior-shaping args is probably preferable. Let the caller decide what behavior is desired for a given date, alignment of the stars, unforeseen business need, or temperature in Bermuda.

      Of course this is only an opinion, and one that has been formulated with less than the full set of facts for this specific use case. :)


      Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-28 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found