Skip Menu |

This queue is for tickets about the Digest CPAN distribution.

Report information
The Basics
Id: 85473
Status: new
Priority: 0/
Queue: Digest

People
Owner: Nobody in particular
Requestors: dabe [...] dabe.com
Cc:
AdminCc:

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



Subject: "local $@" error in Digest 0.17
Date: Mon, 20 May 2013 13:39:55 -0400
To: bug-Digest [...] rt.cpan.org
From: "Dabrien 'Dabe' Murphy" <dabe [...] dabe.com>
While trying to upgrade "IO::Digest" to 0.11 I noticed that one of the tests stopped working: eval { $digest = IO::Digest->new (\*STDOUT, 'CLKAO'); # I don't think there will be Digest::CLKAO }; ok ($@); The problem, it seems, is that the ''exception'' that's being thrown from Digest isn't being propagated back to the original caller: package IO::Digest; # ... sub new { # ... my $digest = Digest->new (@_); # ... } I tracked this down to the "local $@" which appears to have been added in Digest version 0.17. Instead of having it outside the for() loop, I believe it should be closer to the inner eval -- otherwise, the call to die() won't pass the actual exception back to the caller's caller, as it were: --- /tmp/Digest.pm--ORIG 2013-05-20 13:30:06.000000000 -0400 +++ /tmp/Digest.pm--NEW 2013-05-20 13:30:14.000000000 -0400 @@ -27,17 +27,17 @@ $algorithm =~ s/\W+//g; "Digest::$algorithm"; }; $impl = [$impl] unless ref($impl); - local $@; # don't clobber it for our caller my $err; for (@$impl) { my $class = $_; my @args; ($class, @args) = @$class if ref($class); no strict 'refs'; no warnings 'uninitialized'; unless (exists ${"$class\::"}{"VERSION"}) { + local $@; # don't clobber it for our caller my $pm_file = $class . ".pm"; $pm_file =~ s{::}{/}g; eval { require $pm_file }; if ($@) { I hope that helps! Keep up the good work... :-D -- :- Dabe