Thanks for the response. Will the use of fudge only work though if I know the failure point?

Use it in every place there can be a failure ... open or Fudge() ... close or Fudge() ... even readline or Fudge();

while ( ! eof($fh) ) { defined( $_ = <$fh> ) or die Fudge("readline \$fh"); ... }

Heck, even enhance it to sparkle some $? extras

sub Fudge { my $pipe = $?; use Errno(); my $msg = join qq/\n/, "Error @_", map { " $_" } int( $! ) . q/ / . $!, int( $^E ) . q/ / . $^E, grep( { $!{$_} } keys %! ) ; $^E = $! = $pipe; $msg .= join qq/\n/, map { " $_" } "\n #", #~ int( $! ) . q/ / . $!, #~ int( $^E ) . q/ / . $^E, 'status($?) '.( $pipe ), 'subexit($? >>8) '.( $pipe >> 8), 'signal($? & 127) '.( $pipe & 127 ), 'coredump($? & 128) '.( $pipe & 128 ), grep( { $!{$_} } keys %! ), q/ /; return $msg; }

In reply to Re^3: Perl open pipe exiting early by Anonymous Monk
in thread Perl open pipe exiting early by albob

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.