in reply to Simple Question

Hi, This can all be taken care of by manipulating the %SIG hash. To catch ^c and handle it in your own sub, try:

$SIG{QUIT} = \&catchQuit

where catchQuit is the name of your sub to handle ^c.
To ignore ^c altogether, try

$SIG{QUIT} ='IGNORE';
and to restore it:
$SIG{QUIT}='DEFAULT'

PEACE
scmason

Replies are listed 'Best First'.
Re: Re: Simple Question
by hopes (Friar) on Oct 24, 2001 at 13:36 UTC
    Just one comment,

    I've tried this code in a Linux Box and in a Win200K Box and does not ignore control-c

    perl -e 'map{sleep print "$_\n";$SIG{QUIT}='IGNORE'}(1..10)'

    $SIG{QUIT} doesn't do it, but $SIG{INT} does it.

    Yes, I know I shouldn't ab(use) map for this...
    Hope this helps
Re: Re: Simple Question
by scmason (Monk) on Oct 24, 2001 at 21:14 UTC
    My apologies. Everywhere I wrote $SIG{QUIT}, I meant $SIG{INT}.