anshumangoyal has asked for the wisdom of the Perl Monks concerning the following question:
my $count = 10; my @threads = (); for (1..$count) { my $tid = threads->new(\&RunChild, $_); push (@threads, $tid); } foreach (@threads) { my $num = $_->join(); #Here I want to check return code of thread, so that I can report the +error. my $error = ????; if ($error) { print "Thread $num returned error $error\n"; } else { print "Thread $num completed\n"; } } sub RunChild { my $callNum = $_[0]; `curl -o $callNum "http://192.168.1.23/abc.flv"` return $callNum; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Thread Exit Status
by zentara (Cardinal) on Dec 14, 2011 at 11:11 UTC | |
| |
|
Re: Thread Exit Status
by BrowserUk (Patriarch) on Dec 14, 2011 at 10:25 UTC | |
| |
|
Re: Thread Exit Status
by Anonymous Monk on Dec 14, 2011 at 12:26 UTC | |
|
Re: Thread Exit Status
by Tanktalus (Canon) on Dec 15, 2011 at 00:18 UTC | |
by BrowserUk (Patriarch) on Dec 15, 2011 at 01:00 UTC |