anshumangoyal has asked for the wisdom of the Perl Monks concerning the following question:
$pm->run_on_finish ( sub { my ($pid, $exit_code, $ident, $signal, $core) = @_; if ($core) { #If there is a core, report it print "Process $pid dumped core\n"; } else { #Collecting process info in Hash to be reported at the end + of script. #print "Process $pid executed successfully\n"; } $pidInfoHash{$pid} = $exit_code; } ); for (1..$total_calls/$cps) { for (1..$cps) { my $pid = $pm->start and next; RunChild(); $pm->finish; } sleep(1); } 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) { print "Curl Result $curlResult :: Call Drop : $callDrop\n"; $callDrop++; print "Curl Result $curlResult :: Call Drop : $callDrop\n"; } }
|
|---|