http://qs321.pair.com?node_id=856609


in reply to Line by line buffered read

As Ikegami pointed out, sysread is unbuffered io and I see no reason to use it here. It's much easier to use the buffered io functions and here's a simple revision of your example code that does just that.

#!/usr/bin/perl use strict; use warnings; my $fname = '/var/log/Xorg.0.log'; open my $fh, '<', $fname or die $!; while ( my $line = <$fh> ) { print $line; sleep 1; }