My test program
if( @ARGV ){ $SIG{INT} = \&exit_gracefully; for(1..10){ warn "called sleeping $_"; select undef, undef, undef, 0.5; } exit 1; } else { warn "calling system\n"; system ( $^X, __FILE__ , 'called'); $exit_val = $? >> 8; warn "\n exit_val $exit_val"; } sub exit_gracefully { $SIG{INT} = \&exit_gracefully; print "@ARGV Program interrupted .. \n"; exit (2); } __END__
On perl v5.8.4 built for MSWin32-x86-multi-thread under cmd.exe (Windows XP SP1a), it looks as though calling.pl gets interrupted and then delivers a SIGINT to called.pl.
C:\>perl \dev\loose\perlfunc.exit.pl calling system called sleeping 1 at \dev\loose\perlfunc.exit.pl line 4. called sleeping 2 at \dev\loose\perlfunc.exit.pl line 4. called sleeping 3 at \dev\loose\perlfunc.exit.pl line 4. called sleeping 4 at \dev\loose\perlfunc.exit.pl line 4. called sleeping 5 at \dev\loose\perlfunc.exit.pl line 4. Terminating on signal SIGINT(2) C:\>called Program interrupted .. C:\>
On perl v5.8.4 built for i386-linux-thread-multi under bash, I get results as expected
user@host:~$ perl perlfunc.exit.pl calling system called sleeping 1 at perlfunc.exit.pl line 4. called sleeping 2 at perlfunc.exit.pl line 4. called sleeping 3 at perlfunc.exit.pl line 4. called sleeping 4 at perlfunc.exit.pl line 4. called Program interrupted .. exit_val 2 at perlfunc.exit.pl line 14. user@host:~$ user@host:~$

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: exit value not passed back by PodMaster
in thread exit value not passed back by mags

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.