muyprofesional has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w open my( $fh ), '<', "/usr/local/ffpde/logs/pruebas3.log"; my $buffer; while (sysread $fh, $buffer, 100) { my @lines = split(/"\n"/, $buffer); print @lines; sleep 1; }
#!/usr/bin/perl -w open my( $fh ), '<', "/usr/local/ffpde/logs/pruebas3.log"; my $buffer; while (sysread $fh, $buffer, 100) { my @lines = split(/"\n"/, $buffer); for $l (@lines) { print "$l\n"; sleep 1; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Line by line buffered read
by JavaFan (Canon) on Aug 20, 2010 at 16:09 UTC | |
|
Re: Line by line buffered read
by BrimBorium (Friar) on Aug 20, 2010 at 16:34 UTC | |
by dasgar (Priest) on Aug 20, 2010 at 16:47 UTC | |
by muyprofesional (Initiate) on Aug 20, 2010 at 16:55 UTC | |
by muyprofesional (Initiate) on Aug 20, 2010 at 16:58 UTC | |
by ikegami (Patriarch) on Aug 20, 2010 at 17:06 UTC | |
by ibm1620 (Hermit) on Feb 25, 2014 at 00:37 UTC | |
|
Re: Line by line buffered read
by roboticus (Chancellor) on Aug 20, 2010 at 23:32 UTC | |
|
Re: Line by line buffered read
by MajingaZ (Beadle) on Aug 20, 2010 at 18:28 UTC | |
|
Re: Line by line buffered read
by rowdog (Curate) on Aug 22, 2010 at 20:56 UTC |