K
kj
Everyone once in a while, my code produces an error message that
looks like this:
Bizarre copy of HASH in sassign at /usr/share/perl/5.10/Carp/Heavy.pm line 96
I think it's an internal bug somewhere, and I can usually find a
way around it, but still, it's puzzling.
The latest manifestation of this problem occurred while I was
writing unit tests for a module. My test script uses Test::More::throws_ok
to check some error conditions. When checking this one error
condition, it generates the message copied above. But if instead
of writing my test like this:
throws_ok { should_fail() } qr/something went awry/, "exception raised";
I write it like this:
eval { should_fail() };
ok $@ =~ qr/something went awry/, "exception raised";
everything's fine: the test passes, and the "Bizarre copy of HASH..."
error disappears.
If anyone can shed some light on this problem, I'd appreciate it.
TIA!
~K
looks like this:
Bizarre copy of HASH in sassign at /usr/share/perl/5.10/Carp/Heavy.pm line 96
I think it's an internal bug somewhere, and I can usually find a
way around it, but still, it's puzzling.
The latest manifestation of this problem occurred while I was
writing unit tests for a module. My test script uses Test::More::throws_ok
to check some error conditions. When checking this one error
condition, it generates the message copied above. But if instead
of writing my test like this:
throws_ok { should_fail() } qr/something went awry/, "exception raised";
I write it like this:
eval { should_fail() };
ok $@ =~ qr/something went awry/, "exception raised";
everything's fine: the test passes, and the "Bizarre copy of HASH..."
error disappears.
If anyone can shed some light on this problem, I'd appreciate it.
TIA!
~K