28 Apr
2004
28 Apr
'04
12:03 p.m.
Loic Minier wrote:
Jim Mozley <jim.mozley@exponential-e.com> - Tue, Apr 27, 2004:
my @lines = <PIPE>; for ( @lines ) { # do some stuff }
This causes reading until the End Of File of PIPE, then you process all lines.
Instead, I suggest you try:
while ( <PIPE> ) { # do some stuff }
[ Syslog-NG opens a pipe to your program when it is started and closes it when it's stopped. It doesn't open a new pipe for each log line. ]
Thanks, I understood this was the case for a pipe as in two commands with a | but didn't know it kept a fifo open too. Should have guessed this from the behaviour. Thanks, Jim Mozley