Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 50433
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.091
Fixed in: (no value)



Subject: Signal handling in Mail::Box
In the source code of Mail::Box there's the line $SIG{INT} = $SIG{QUIT} = $SIG{PIPE} = $SIG{TERM} = sub {exit 0}; I feel uneasy about this. I believe that signal handling should be exclusively in a script/program/app, but not in a module. It's not clear how the conflicting case of script and module both defining the same signal handler should be handled. Consider this: #!/usr/bin/perl $SIG{INT} = sub { die "my sig handler" }; require Mail::Box; while() {} __END__ Here the user-defined signal handler is overwritten by Mail::Box's definition. Some kind of action-at-a-distance. And here: #!/usr/bin/perl use Mail::Box; $SIG{INT} = sub { die "my sig handler" }; while() {} __END__ Mail::Box's signal handler is overwritten by the user-defined one. I think it's best to remove the definition at all from Mail::Box. Regards, Slaven
Subject: Re: [rt.cpan.org #50433] Signal handling in Mail::Box
Date: Tue, 13 Oct 2009 11:41:01 +0200
To: Slaven_Rezic via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Slaven_Rezic via RT (bug-Mail-Box@rt.cpan.org) [091013 09:29]: Show quoted text
> Tue Oct 13 05:29:25 2009: Request 50433 was acted upon. > Transaction: Ticket created by SREZIC > Queue: Mail-Box > Subject: Signal handling in Mail::Box > Broken in: 2.091 > > In the source code of Mail::Box there's the line > $SIG{INT} = $SIG{QUIT} = $SIG{PIPE} = $SIG{TERM} = sub {exit 0}; > > I feel uneasy about this. I believe that signal handling should be > exclusively in a script/program/app, but not in a module. It's not clear > how the conflicting case of script and module both defining the same > signal handler should be handled.
I fully agree: an awful misfeature which I will remove immediately. How did it get there? Was I brain-dead? -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
This got fixed in 2.092. Forgot to close the ticket