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

Re^2: Close a file and reopen a new one at midnight

by 0day (Sexton)
on Jan 14, 2013 at 18:15 UTC ( #1013255=note: print w/ replies, xml ) Need Help??


in reply to Re: Close a file and reopen a new one at midnight
in thread Close a file and reopen a new one at midnight

I believe that this time it was put to test.
However, if for one minute data are not received, this condition is not met. if($hrmin == 1114)


Comment on Re^2: Close a file and reopen a new one at midnight
Download Code
Re^3: Close a file and reopen a new one at midnight
by ww (Bishop) on Jan 14, 2013 at 18:24 UTC
    update: MidLifeXis' explanation got thru my thick skull... and seems plausible. Apologies for wasting the effort of so many electrons and Monks but I do think the last graf still stands... and, FTR, a comment or narrative explanation of "1144" by the OP would have been, IMO, highly desireable.

    Monk 0day: Would you kindly explain your statements? I don't see that either has any relevance.

    "1144" remains a representation of an hour and minute that are not even close to midnight but it's being used as the code for the question "Is it almost midnite, and time to close the old log file and open a new one?"

    and NJBTW, any update of $ymd " after sleep 1 at 11:44AM is not going to be any different than the old one, so while there will be a new file created, it will have the same name as (and overwrite) the previous one. The test MUST occur much closer to midnight and with an appropriate sleep to ensure the calendar turns to another day.

      The 1114 was close to the posting time of the node. The assumption that I made is the same as 0day's, that the time provided was to allow for testing during the work day.

      It could should have been stated explicitly by the OP that '1114' was a time used for testing.

      The second statement is saying that unless data is received on the socket in the specified minute, the rollover code is never executed.

      --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-10-31 10:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (216 votes), past polls