My initial thoughts are that "program A" might be the best place to be adding this error checking and logging. Not sure if modifying "program A" is an option.

Another route would be to have the Perl script check periodically to see if "program B" is still running. Of course, this method might not be able to distinguish between a) up and running properly and b) running but not responding.

The only other way that I can think of is to have the Perl script periodically check on the file that "program A" is writing to. You could use something like stat to check for the last modified time stamp. I haven't use this module, but it looks File::Monitor might be another method for checking to see if the file has changed.

Perhaps more knowledgable and experienced monks can come up with better solutions/ideas. Thought I'd toss out these ideas in case one of them might help you out.


In reply to Re^5: Check for a new line by dasgar
in thread Check for a new line by h123

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.