in reply to Re^2: Perl open pipe exiting early
in thread Perl open pipe exiting early
$! returned empty. I could well be using it incorrectly though.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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl open pipe exiting early
by choroba (Cardinal) on Apr 03, 2015 at 13:44 UTC | |
by albob (Sexton) on Apr 03, 2015 at 14:55 UTC | |
|
Re^4: Perl open pipe exiting early
by RichardK (Parson) on Apr 03, 2015 at 13:50 UTC | |
by albob (Sexton) on Apr 03, 2015 at 14:57 UTC |