Is there a way to disallow the CtrlC command to stop a script running in Perl.
I am aware of of the $SIG{'INT'} but I wanted to know for a way that if CtrlC is pressed the script would NOT stop no matter what.
At the moment I have:
$SIG{'INT'};
## for loop here
But once the for loop is over, if CtrlC is pressed, the script will stop.
Ignore interrupts completely:
$SIG{'INT'} = 'IGNORE';
Alternatively, map the interrupt to a different character - DEL maybe; then Control-C no longer generates an interrupt (or any other signal) and is a 'normal' control character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With