in reply to Re: Perl open pipe exiting early
in thread Perl open pipe exiting early

Yes, I missed that one. I should be doing that. Hopefully that will give me a pointer. Thanks

Replies are listed 'Best First'.
Re^3: Perl open pipe exiting early
by albob (Sexton) on Apr 03, 2015 at 13:03 UTC
    No luck with this, ubless I messed up the way I added it:
    my $run_pid = open(RUN, "sub_script.pl $options 2>&1 |") or $sub_fai +led = 1; if (!$sub_failed) { $text .= "Entered if (!\$sub_failed) {\n"; while (<RUN>) { $text .= "Entered while (<RUN>)\n"; chomp; $_ =~ s/^\s*//; $text .= "$_\n"; } close(RUN); if ($? != 0) { $sub_failed = 1; $text = "Open error: $!\n";} } else { $text .= "Failed to open sub_script.pl\n";} print "$text";
    $! returned empty. I could well be using it incorrectly though.
      Calling close changes $!. Store its value immediately after the failed open.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        Okay, trying this now.
        I would if I could reproduce the issue! :) The issue is intermittent. I have several hundred users running the script thousands of times a day. I get a mail when there is an issue....and different users see it at different times. A user could run the script, see the issue, rerun it immediately and not see the issue.