Is there another way I should be approaching this task?

How about not using tail?  I'm just ripping this off from the 'Perl
Cookbook' but:

        for (;;) { #ever and ever 
                while (<MAILLOG>)
                        # Do your thing
                }
        
                sleep $awhile;
                seek(MAILLOG, 0, 1);
        }
They claim that doing a seek will reset the EOF to the new position if there
is one.  They also have a solution using IO::Handle and its clearerr()
method.  Pretty much the same thing but add a use IO::Handle at the top and
change the seek to MAILLOG->clearerr();

Peter C.

Reply via email to