perlcapt has asked for the wisdom of the Perl Monks concerning the following question:

How does tail -f, the follow mode to tail, work its magic? Is there any way to open a file similarly in Perl?
perlcapt
-ben

Replies are listed 'Best First'.
Re: following a file with Perl
by reneeb (Chaplain) on Jun 18, 2006 at 15:49 UTC
Re: following a file with Perl
by McDarren (Abbot) on Jun 18, 2006 at 15:50 UTC
    How does tail -f, the follow mode to tail, work its magic?
    man tail
    Is there any way to open a file similarly in Perl?
    Yes, File::Tail
Re: following a file with Perl
by sgifford (Prior) on Jun 18, 2006 at 16:15 UTC
Re: following a file with Perl
by liverpole (Monsignor) on Jun 18, 2006 at 18:04 UTC
    Hi perlcapt,

    A similar question was asked 5 days, ago (and got similar responses).  In particular, I'd recommend looking at my response if you're interested in the specifics of how you might write your own subroutine to mimic tail -f.


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/