my $timeout = 24*60*60 - ($hour*3600 + $min*60 + $sec); while(1) { eval { local $SIG{ALRM} = sub { die; }; alarm($timeout); while (my $line = <$sock>) { ................. } alarm(0); }; $timeout = 24*60*60; }
In reply to Re: Close a file and reopen a new one at midnight
by 0day
in thread Close a file and reopen a new one at midnight
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |