Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Deep CPAN distribution.

Report information
The Basics
Id: 85444
Status: rejected
Priority: 0/
Queue: Test-Deep

People
Owner: Nobody in particular
Requestors: victor [...] vsespb.ru
Cc:
AdminCc:

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



Subject: superhash() does not localize $@
Download (untitled) / with headers
text/plain 287b
superhash() does not localize $@ so, you can't write code like this ok ! defined eval {die { a => 1, b => 2}; }; cmp_deeply $@, superhashof { a => ... }; I believe this is because perl 'require' (which is used inside superhash) will reset $@. I think that can be fixed using local $@
Download (untitled) / with headers
text/plain 583b
On 2013-05-19 09:06:42, vsespb wrote: Show quoted text
> superhash() does not localize $@ > > so, you can't write code like this > > ok ! defined eval {die { a => 1, b => 2}; }; > cmp_deeply $@, superhashof { a => ... }; > > I believe this is because perl 'require' (which is used inside superhash) > will reset $@. I think that can be fixed using local $@
I don't think this is a bug. If you care about keeping the content of $@ beyond the next expression, copy it into a local lexical yourself and then test against that. Globals like $@ are fair game for being overwritten at any later time.
From: victor [...] vsespb.ru
Download (untitled) / with headers
text/plain 711b
Well, fair enough. I would treat it as whishlist On Wed Aug 14 00:52:16 2013, ETHER wrote: Show quoted text
> On 2013-05-19 09:06:42, vsespb wrote:
> > superhash() does not localize $@ > > > > so, you can't write code like this > > > > ok ! defined eval {die { a => 1, b => 2}; }; > > cmp_deeply $@, superhashof { a => ... }; > > > > I believe this is because perl 'require' (which is used inside > > superhash) > > will reset $@. I think that can be fixed using local $@
> > > I don't think this is a bug. If you care about keeping the content of > $@ beyond the next expression, copy it into a local lexical yourself > and then test against that. Globals like $@ are fair game for being > overwritten at any later time.
This kind of $@ accounting is almost certainly not going to get done. -- rjbs


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.