Help for this page

Select Code to Download


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