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 $@
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.12-27281-1368979602-978.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 287
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 $@
MIME-Version: 1.0
In-Reply-To: <rt-4.0.12-27281-1368979602-978.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.12-27281-1368979602-978.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.16-12947-1376427136-1669.85444-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 583
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.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.16-12947-1376427136-1669.85444-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: API
References: <rt-4.0.12-27281-1368979602-978.0-0-0 [...] rt.cpan.org> <rt-4.0.16-12947-1376427136-1669.85444-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.16-16924-1376428594-407.0-0-0 [...] rt.cpan.org>
Message-ID: <rt-4.0.16-16924-1376428594-551.85444-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
From: victor [...] vsespb.ru
Content-Length: 711
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.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.12-27281-1368979602-978.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.12-27281-1368979602-978.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-4556-1385823084-597.85444-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 79
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.