in reply to Too many pipes?

Ok so I rewrote the sub letting perl handle the work rather than system calls.

This is a bit sloppy I admit. But it is a working solution to the issues. Keep in mind this is feeding a CGI script on a system I do not have access to. All the output is displayed to the user via a web browser. Please comment on any clean up.

##### sub tail_file { my $node = shift; my $name="/var/log/syslog"; my $x = -1; if ($node =~ /all nodes/i){ $x = 15; } print "<h2>Tailing /var/log/syslog...</h2><br>\n"; use File::Tail; my $file=File::Tail->new(name=>$name, tail=>$x); while (defined(my $line=$file->read)) { if ($node =~ /all nodes/i) { print "$line<br>\n"; }else{ my @line2 = grep {/$node/i} $line; foreach my $line3 (@line2) { chomp $line3; $line3 =~ s/\s/$space/g; print "$line3<br>\n"; } } } } #####