in reply to Re^3: Parallel::ForkManager run_on_finish Canot get Exit Code of Child process
in thread Parallel::ForkManager run_on_finish Canot get Exit Code of Child process

This is what I did:
sub RunChild { if (defined $proxy) { $ENV{http_proxy}="$proxy"; } $logFile = $logDir."/header_".$call; `curl -o /dev/null -m 222 \"$Link\" 2>> $logFile`; my $curlResult = `echo $?`; chomp($curlResult); if ($curlResult != 0) { exit($curlResult); } }
  • Comment on Re^4: Parallel::ForkManager run_on_finish Canot get Exit Code of Child process
  • Download Code

Replies are listed 'Best First'.
Re^5: Parallel::ForkManager run_on_finish Canot get Exit Code of Child process
by ikegami (Patriarch) on Dec 02, 2011 at 09:47 UTC

    First,

    my $curlResult = `echo $?`; chomp($curlResult);
    is the same thing as
    my $curlResult = $?;

    Second, $? doesn't contain the exit code. Well, not just the exit code. See its documentation.

Re^5: Parallel::ForkManager run_on_finish Canot get Exit Code of Child process
by ikegami (Patriarch) on Dec 02, 2011 at 09:49 UTC

    First,

    my $curlResult = `echo $?`; chomp($curlResult);
    is the same thing as
    my $curlResult = $?;

    Second, $? doesn't contain the exit code. Well, not just the exit code. See its documentation.