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; }
In reply to Re: Line by line buffered read
by rowdog
in thread Line by line buffered read
by muyprofesional
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |