Skip Menu |
 

This queue is for tickets about the IO-Compress CPAN distribution.

Report information
The Basics
Id: 128538
Status: resolved
Priority: 0/
Queue: IO-Compress

People
Owner: Nobody in particular
Requestors: FANY [...] cpan.org
Cc: IT-957 [...] jira.mensa.de
AdminCc:

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



CC: IT-957 [...] jira.mensa.de
Subject: out $SIG{__DIE__} handlers being called when optional modules are not installed
Download (untitled) / with headers
text/plain 1.9k
$ perl -E '$SIG{__DIE__}=sub{say"Handler called: @_"};require IO::Uncompress::Unzip' Handler called: Can't locate IO/Uncompress/Adapter/UnLzma.pm in @INC (you may need to install the IO::Uncompress::Adapter::UnLzma module) (@INC contains: /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.26.1 /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.26.1 /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1 /usr/lib/perl5/site_perl) at /usr/lib/perl5/5.26.1/IO/Uncompress/Unzip.pm line 25. You should IMHO prevent that by locally disabling these handlers; see "perldoc -f eval": Using the "eval {}" form as an exception trap in libraries does have some issues. Due to the current arguably broken state of "__DIE__" hooks, you may wish not to trigger any "__DIE__" hooks that user code may have installed. You can use the "local $SIG{__DIE__}" construct for this purpose, as this example shows: # a private exception trap for divide-by-zero eval { local $SIG{'__DIE__'}; $answer = $a / $b; }; warn $@ if $@; Regards fany
Thanks. Good catch.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.