The following code is not able to trap a signal (when i press ctrl-c).
It doesnt call the subroutine sig_handler.
1. File a.pl call b.pl which runs in an infinite loop,
as soon as i run the command=>
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.
print "In A\n";
print "In B\n";
I m using linux and perlv5.8.8..
Please suggest a solution that will work on windows as well as linux.
The code is working on windows using Active perl v5.8.8.
I mean i get the message "Sig trapped" on windows.