Skip Menu |

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

Report information
The Basics
Id: 15870
Status: resolved
Priority: 0/
Queue: Test-Class

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

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



Subject: wish: better diagnostics for "Can't use an undefined value as a HASH reference at /usr/local/lib/perl5/site_perl/5.8.0/Test/Class.pm line 58"
Hello, this was my first impression from running Test::Class: Can't use an undefined value as a HASH reference at /usr/local/lib/perl5/site_perl/5.8.0/Test/Class.pm line 58 It would be nice to have a more informative error message here. Most likely I did something wrong, but this message points to the point in Test::Class where the thing exploded, not where I lit the fuse. Perhaps Carp or something could help here. Maybe I'll send a patch if I figure out WTF. Mark
Sorry about that. A snippet of code that demonstrates the problem would be nice ;-) [guest - Wed Nov 16 15:56:54 2005]: Show quoted text
> Hello, this was my first impression from running Test::Class: > > Can't use an undefined value as a HASH reference at > /usr/local/lib/perl5/site_perl/5.8.0/Test/Class.pm line 58 > > It would be nice to have a more informative error message here. Most > likely I did something wrong, but this message points to the point in > Test::Class where the thing exploded, not where I lit the fuse. > > Perhaps Carp or something could help here. > > Maybe I'll send a patch if I figure out WTF. > > Mark
From: ted [...] tedcarnahan.com
I encountered this problem with this code: package UnwantedTest; use strict; use warnings; use base qw/ Class::Accessor /; use base qw/ Test::Class /; # ERROR 1; But solved it by inverting the order of the use base calls: package UnwantedTest; use strict; use warnings; use base qw/ Test::Class /; # WORKS use base qw/ Class::Accessor /; 1; This might not be a bug, but the diagnostic should probably be improved and this behavior should be documented, methinks. - Ted Carnahan On Wed Nov 16 15:56:54 2005, guest wrote: Show quoted text
> Hello, this was my first impression from running Test::Class: > > Can't use an undefined value as a HASH reference at > /usr/local/lib/perl5/site_perl/5.8.0/Test/Class.pm line 58 > > It would be nice to have a more informative error message here. Most > likely I did something wrong, but this message points to the point in > Test::Class where the thing exploded, not where I lit the fuse. > > Perhaps Carp or something could help here. > > Maybe I'll send a patch if I figure out WTF. > > Mark
The problem was caused by the new() method of Test::Class being overridden via multiple inheritance. You now get a much more sane error message when this happens. Fix in v0.18 hitting CPAN now. Adrian