I am writing a perl script to get the exit status of each thread from the parent process. if i use join() i am not able to get the thread proper exit status.
how to capture the exit status of each thread from parent process ?
here is code
foreach (@threads) {
$_->join();
}
sub sub1 {
print "I am thread1\n";
exit(20);
}
sub sub2 {
print "I am thread2\n";
}
sub sub3 {
print "I am thread3\n";
}
sub sub4 {
print "I am thread4\n";
}
sub sub5 {
my $i=10/0;
print "$i\n";
print "I am thread5\n";
}