in reply to Close a file and reopen a new one at midnight
AM,
Two things after a glace at your code;
- $hrmin is a string, and you're testing as a number.
if ( $hrmin eq '1114' ) {
- '1114' is before noon, '2359' is before midnight. You also should be concerned about seconds. A lot can happen in 60 seconds.
You may want to buffer the end of the day, which may give you a more accurate end-of-day and start-of-day.
Good Luck!
"Well done is better than well said." - Benjamin Franklin
In Section
Seekers of Perl Wisdom