http://qs321.pair.com?node_id=277167


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/