Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: reading output from another script

by jmanning2k (Pilgrim)
on Jul 23, 2003 at 20:10 UTC ( [id://277321]=note: print w/replies, xml ) Need Help??

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
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://277321]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-25 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found