- or download this
# monitor.pl
while(<>) {
...
if(/warning/) {dosomethingelse($_); }
print; ## pass on the output
}
- or download this
# monitor.pl
open(INPUT, "./script |") or die $!;
...
print;
}
close INPUT;
- or download this
# adapted from Perl Cookbook
sub filteroutput {
...
}
exit; #exit forked monitoring process
}