Dec 14, 2009, 9:09 AM
Post #1 of 3
system() seems to behave funnily here:
Return value of system()
my $exit_val = system("perl -e 'use English; use strict; kill 11, \$PID");
I get 35584 (ie. Exit value: 139, Signal: 0, Coredump: 0) which is incorrect
If I write the same code in a separate perl file (say abc.pl) and execute abc.pl via system then:
my $exit_val = system("perl abc.pl");
I get 139 (ie. Exit value: 0, Signal: 11, Coredump: 127) which is correct.
Can anyone please point out the reason for this discrepancy?