in reply to Is the signal handler supposed to work like this?
Is another Perl interpreter instance being launched to handle that eval()? Or is the first instance looking for all of the places that twiddle %SIG, and evaluating them upfront? Perhaps there are only a handful of things (like spawning a thread or calling eval()) can get the Perl interpreter to push the state of %SIG down into the operating system?#!perl -w use strict; print "Enter CTRL-C to end input\n"; $SIG{INT} = 'IGNORE'; my @rv = <STDIN>; eval q/$SIG{INT} = 'DEFAULT'/; chomp @rv; print "Enter CTRL-C to exit\n"; while ( 1 ) { local($") = ', '; print "You entered: @rv\n"; sleep(1); }
|
|---|