Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

watch-script.pl | less +F buffering problem?

by axelrose (Scribe)
on Aug 18, 2006 at 13:15 UTC ( [id://568136] : perlquestion . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    terminal1 $ touch /tmp/my.log
    terminal2 $ perl script.pl -p . /tmp/my.log | less +F
    terminal1 $ echo "lala" >> /tmp/my.log
    terminal1 $ echo "lala" >> /tmp/my.log
    terminal1 $ ...
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    
    ...
        sleep $sleep;
        seek(LOGFILE, 0, 1);
    }