Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: reading output from another script

by Chady (Priest)
on Jul 23, 2003 at 14:31 UTC ( #277167=note: print w/replies, xml ) Need Help??


in reply to reading output from another script

Why the array? can't you just pipe it and read one line at a time?

#script.pl $|++; my $i = 0; while (1) { $i++; print $i % 50000 == 0 ? "Event" : "stuff\n"; } #monitor.pl while (<STDIN>) { if (/Event/) { notify(); } } sub notify { print "Got notification.\n"; } $ ./script.pl | ./monitor.pl
Update: added sub notify { } in code.
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2022-01-27 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (72 votes). Check out past polls.

    Notices?