Help! I am in need of some divine wisdom!

I have been asked if there is a way to monitor the output of an exsisting script and send an email notification if a certain event occurs. The script that runs dumps its output to standard out, and runs forever or until killed.(Imagine doing a tail -f on syslog.log or something, they want to be notified if a certain condition occurs) I tried throwing it into an array, but that just sits there until it is finished getting STDIN, which in the case of this script, never happens so that doesnt work...

So my question is this: Is there a way to my perl script monitor in real time the output of another script while it is dumping output? they are looking for a way to do a

./script |./monitor.pl or just
have ./monitor.pl call script and watch it...either way works...but I am starting to doubt that it can be done..

Please advise....

update (broquaint): added <code> tags and some further formatting


In reply to reading output from another script by Octavian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.