R
Rocky
hello everyone. I have a problem and I need assistance. this script
prints output to STDOUT just fine but for some reason will no print to FH1
or FH2. I am wondering if it prints the data to memory then writes it out
to the file at close.
#!/usr/bin/perl
use warnings;
use strict;
open(FH3,"</var/run/syslogdpipe") or die "$!\n"; #this is a fifo
open(FH1,">./mx0out");`
open(FH2,">./mx1out");
while (<FH3>)
{
my $line = $_;
if ($line =~ /^.*svr-linux.*$/)
{
print "mx00 $line\n";
}
elsif ($line =~ /^.*192\.168.*$/)
{
print "mx01 $line\n";
}
}
prints output to STDOUT just fine but for some reason will no print to FH1
or FH2. I am wondering if it prints the data to memory then writes it out
to the file at close.
#!/usr/bin/perl
use warnings;
use strict;
open(FH3,"</var/run/syslogdpipe") or die "$!\n"; #this is a fifo
open(FH1,">./mx0out");`
open(FH2,">./mx1out");
while (<FH3>)
{
my $line = $_;
if ($line =~ /^.*svr-linux.*$/)
{
print "mx00 $line\n";
}
elsif ($line =~ /^.*192\.168.*$/)
{
print "mx01 $line\n";
}
}