|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re: Close a file and reopen a new one at midnightby MidLifeXis (Prior) |
| on Jan 14, 2013 at 17:59 UTC ( #1013250=note: print w/ replies, xml ) | Need Help?? |
|
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
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||