Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

following a file with Perl

by perlcapt (Pilgrim)
on Jun 18, 2006 at 15:46 UTC ( #556110=perlquestion: print w/ replies, xml ) Need Help??
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

Comment on following a file with Perl
Download Code
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$..$/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://556110]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (19)
As of 2015-07-29 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls