It's pretty crude to kill a process because it gets too big. Any Unix-like OS worth it's salt will do this for you usually on a user-id basis (man ulimit). Probably not the best way to go if you can avoid it.

One thing that I'm not too clear on is that you say the process is returning all of the output at once as a hash. How does it do this? Perl hashes are typically converted into some kind of output stream (printed to a temp file, sent as text over a pipe, etc) before they can be sent to another process.

Also, is the other process really saving everything to the very end before it writes the output, or is the receiving process slurping in the output all at once...

$all_the_output = `my_shell_command`;
If this is what is going on, you may want to try reading from a pipe instead...
$pid = open(PIPE, "my_shell_command |") or die; while ($line = <PIPE>) { if ($i_received_too_much_garbage) { kill $my_favorite_signal => $pid; } } ...
bluto

In reply to Re: using Proc::ProcessTable::Process by bluto
in thread using Proc::ProcessTable::Process by aijin

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.