Subject: | $^S ($EXCEPTIONS_BEING_CAUGHT) not being set when Socket, Socket6, IO::Socket::IP, or IO::Socket::INET6 fail to load in eval |
When the evals in the BEGIN block that checks for $ip6 fail, it is not setting the $^S variable indicating that the exception was caught in an eval.
Here is an example one-liner showing the issue:
Show quoted text
> perl -Ilib/ -le '$SIG{__DIE__} = sub { print qq{Err: $_[0]\$^S: $^S}; }; require IO::Socket::SSL;'
Err: Can't locate object method "tid" via package "threads" at /usr/local/perl-5.14.2/lib/XSLoader.pm line 95.
$^S: 1
Err: Socket version 1.95 required--this is only version 1.94 at lib//IO/Socket/SSL.pm line 92.
$^S:
Err: Can't locate IO/Socket/IP.pm in @INC (@INC contains: lib/ /usr/local/perl-5.14.2/site/lib /usr/local/perl-5.14.2/lib /ublocal/lib/perl5/lib/perl5/sun4-solaris-thread-multi-64 /ublocal/lib/perl5/lib/perl5/sun4-solaris-thread-multi /ublocal/lib/perl5/lib/perl5 /ublocal/lib/perl .) at lib//IO/Socket/SSL.pm line 106.
$^S:
The first error shown is from Net::SSLeay (v1.48) and seems to be trapped properly, but the others are from IO::Socket::SSL and don't have the $^S value set properly. This causes problems with my custom error handler because I can't tell that the error was trapped and can be ignored.
I am using Perl 5.14.2 on Solaris 10.