This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Carp: Don't autovivify the CARP_NOT or ISA array
authorBrian Fraser <fraserbn@gmail.com>
Mon, 13 May 2013 19:37:22 +0000 (16:37 -0300)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 9 Jun 2013 21:26:51 +0000 (14:26 -0700)
commit79f8d0e810e1442ce47a0b1e112c5f2b83d637a2
tree6101a87ea6c132e5d3683f982b4c4fdec904c24f
parent1a4f8f41aa38eebfdff591e350c60fd1832af3fb
Carp: Don't autovivify the CARP_NOT or ISA array

In this situation:

    use Carp;
    package Foo;
    $CARP_NOT = 1;
    warn *{$Foo::{CARP_NOT}}{ARRAY} || 'undefined';
    eval { Carp::croak(1) };
    warn *{$Foo::{CARP_NOT}}{ARRAY} || 'undefined';

The second warn shows that Carp is autovivifying the ARRAY slot
of the glob.  This commit builds on the previous and checks that
the array exists before trying to use it.
dist/Carp/lib/Carp.pm
dist/Carp/t/Carp.t