in reply to Re^2: POE::Wheel questions
in thread POE::Wheel questions
Log file: Sorry, I don't have any suggestions if you can't control your consumers. In that case, there's no point in calling the system 'cat' command - it will just do the same thing: open the file in append (well, the shell will do that), which automatically seeks to the end, write out, and close the filehandle. That would be even more inefficient.
Mind you, if the rotation happens before the files get too large, the inefficiencies will be reduced. Each time you open a file and seek to the end, you won't seek very far, which will limit the ugliness. Note that it may still be an O(n) operation to seek to the end, but we're keeping n from getting too large.
As for your timeout, I don't see any way to disable it. Better, then, may be simply to handle it by retrying. Set the errmode to 'return', and test to see if getline returns undef. Check the timed_out method to see if the undef is because of a timeout (then redo) or not (then last to end the loop - you're disconnected, most likely).
$telnet->errmode('return'); while (my $line = $telnet->getline(Timeout => 3600)) { if (not defined $line and $telnet->timed_out()) { # print LOGFILE "It's been an hour since the last text... still wa +iting.\n"; redo; } print $line; }
Hope that helps,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: POE::Wheel questions
by shockers (Acolyte) on Oct 04, 2005 at 07:22 UTC |