debugger has asked for the wisdom of the Perl Monks concerning the following question:
1. File a.pl call b.pl which runs in an infinite loop,
as soon as i run the command=>
perl a.pl
I get "In B" as output and it continues in infinite loop.
However when i press ctrl-c , "In A" is printed and program exits.
The statement "Sig trapped" is not printed at all.
a.pl :
$SIG{INT}=\&sig_handler; system("perl b.pl"); print "In A\n"; sub sig_handler { printf("Sig trapped.\n"); }
I m using linux and perlv5.8.8.. Please suggest a solution that will work on windows as well as linux.print "In B\n"; for(;;) { }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: signal handling
by crashtest (Curate) on Feb 15, 2010 at 21:11 UTC | |
by debugger (Novice) on Feb 16, 2010 at 13:10 UTC | |
Re: signal handling
by Anonymous Monk on Feb 15, 2010 at 15:12 UTC | |
by debugger (Novice) on Feb 15, 2010 at 15:15 UTC | |
by ikegami (Patriarch) on Feb 15, 2010 at 16:41 UTC | |
by Anonymous Monk on Feb 15, 2010 at 15:17 UTC |