Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Is the signal handler supposed to work like this?

by jbert (Priest)
on Aug 30, 2008 at 12:37 UTC ( #707908=note: print w/ replies, xml ) Need Help??


in reply to Is the signal handler supposed to work like this?

Hmm...your "ignoring SIGINT" approach works for me on Windows:

#!/usr/bin/perl use warnings; use strict; my @lines; { $SIG{INT} = 'IGNORE'; @lines = <STDIN>; } print "You entered: " . join("", @lines)
perl 5.10.0 MSWin32-x86-multi-thread (strawberry perl).


Comment on Re: Is the signal handler supposed to work like this?
Download Code
Re^2: Is the signal handler supposed to work like this?
by dpmott (Scribe) on Sep 05, 2008 at 02:49 UTC
    Right... but now ctrl-C is ignored for the entire life of the script. And, if the signal handler is reset back to default later in the script, it doesn't keep the script from dying as a result of the ctrl-C.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://707908]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (16)
As of 2014-12-18 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls