http://qs321.pair.com?node_id=513049

lepetitalbert has asked for the wisdom of the Perl Monks concerning the following question:

Hello dear Monks,

I tried all %SIG's :

... $SIG{HUP} = sub { print "You cannot HUP me !"; }; $SIG{ILL} = sub { print "You cannot ILL me !"; }; $SIG{INT} = sub { print "You cannot INT me !"; }; ... while (1) { print "\nyes"; sleep (1); }

Complete code here.

This works with ctrl+c (it prints 'You cannot INT me !' and goes on).
But when I close cmd.exe, it prints 'You cannot HUP me !' and die.

Any idea ?

Thanks.

Have a nice day.

"There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates