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

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

by MidLifeXis (Monsignor)
on Jan 14, 2013 at 17:59 UTC ( #1013250=note: print w/ replies, xml ) Need Help??


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

Is there sufficient log activity for the $hrmin check to have a large enough resolution, or is it possibly skipping over your check time?

If the check is only for the date, why not do a comparison to see if the last date matches the current date?

I also note that you are never recalculating the datetime, so $hrmin and $ymd never change during the lifetime of your while (<$sock>) loop.

Update: Be careful if this restarts. Instead of appending to the current date's log file, you will clobber it and truncate it at the beginning with your open statement. Consider using '>>' instead of '>'.

--MidLifeXis


Comment on Re: Close a file and reopen a new one at midnight
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2015-07-31 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls