This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Carp: Stop polluting the caller's namespace if they lack @CARP_NOT or @ISA
authorBrian Fraser <fraserbn@gmail.com>
Mon, 13 May 2013 18:57:18 +0000 (15:57 -0300)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 9 Jun 2013 21:23:46 +0000 (14:23 -0700)
commit1a4f8f41aa38eebfdff591e350c60fd1832af3fb
treef18f82415eeeafbaa0025015ec35a060938c6f7b
parent9b3e256ba8b6c2c4da93505f20c594c38b97cb81
Carp: Stop polluting the caller's namespace if they lack @CARP_NOT or @ISA

Turns out that this:

perl -MCarp -le 'package Foo; eval { Carp::croak(1) }; print keys %Foo::;'

Would leave two new symbols in Foo, CARP_NOT and ISA. This commit
changes trusts_directly() to check if the symbols exists in the
stash before using them.
dist/Carp/lib/Carp.pm
dist/Carp/t/Carp.t