Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Question On signals in perl

by SimonClinch (Deacon)
on Aug 01, 2005 at 13:37 UTC ( #479892=note: print w/replies, xml ) Need Help??


in reply to Question On signals in perl

A signal is notification to the process of a (nominally) asynchronous event. Examples are:

INT - the process has been interrupted e.g. by ctrl/c

HUP - the attached terminal session has disconnected ("been hanged up")

PIPE - a broken pipe has been detected

TERM - synchronous termination has been requested

and so on.

A simple listing of all signal names can be found by:

perl -e 'use Data::Dumper; print Dumper( \%SIG );'
The default signal handler (which generally just terminates the process as soon as it is invoked) can instead be trapped to your own code (sometimes called an AST or asynchronous system trap) by defining a routine reference as the relevant value in the %SIG hash, e.g.
$SIG{ HUP } = \&MyNoHup;
or
$SIG{ PIPE } = sub { warn ( "Broken pipe ignored; traceback follows:\n +" . Devel::trace() ); }
There are some modules which also assist signal handling, including POSIX

One world, one people

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://479892]
help
Chatterbox?
[marto]: I don't think their inability to make any sense is related to alcohol
[Discipulus]: their?
[karlgoethebier]: marto: "their inability.." Perhaps the result of a wrong education?
[karlgoethebier]: or no education?
[choroba]: their = his or her
[Discipulus]: anyway once I proposed an automatic font decrease for post below -1, stepping every 5 votes: i'm still thinks it's a good idea but dunno if feasible
[shmem]: ...emulated dual in english
[shmem]: Discipulus: has that been in the CB? or in a PM node proper? for the latter case, can you provide the ID?
[Discipulus]: you seriously can use their in this way in eng?

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2017-05-23 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?