Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Keeping a loop aliveby fuzzyping (Chaplain) |
on May 31, 2003 at 14:52 UTC ( [id://262073]=perlquestion: print w/replies, xml ) | Need Help?? |
fuzzyping has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on a logging system for OpenBSD's PF that reads from the pflog interface via tcpdump and writes to MySQL. Everything works fine, except... when a "flush state" or "flush all" command is sent, it appears to reset the interface, causing tcpdump to die and the while loop to close and end the script. Is there a good way of re-opening the filehandle once it's closed and re-starting the loop? Here's a very simplified version: I guess it would be nice to put the loop inside its own sub (it's currently in the main flow), and then run some sort of true/false test on the state of <IN> from the filehandle. Any suggestions? TIA, -fp
Back to
Seekers of Perl Wisdom
|
|