diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-09 18:21:46 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-09 18:21:46 +0000 |
commit | ddc53c8b92d8feb3e2103b02f41617a2abf20574 (patch) | |
tree | 0bdbfae06ec9e13508418a66fc57a7afd7fe6840 /lib/Exporter | |
parent | 9380b46b3d37c131ab8ce5026cc41ca0f63d3c60 (diff) | |
download | perl-ddc53c8b92d8feb3e2103b02f41617a2abf20574.tar.gz |
Instead of muting symbol export error if under eval,
delay the errors until the croak().
(replaces #13408)
p4raw-id: //depot/perl@13556
Diffstat (limited to 'lib/Exporter')
-rw-r--r-- | lib/Exporter/Heavy.pm | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Exporter/Heavy.pm b/lib/Exporter/Heavy.pm index 76a5bad17c..b3afe9cbc3 100644 --- a/lib/Exporter/Heavy.pm +++ b/lib/Exporter/Heavy.pm @@ -109,6 +109,7 @@ sub heavy_export { @imports = keys %imports; } + my @carp; foreach $sym (@imports) { if (!$export_cache->{$sym}) { if ($sym =~ m/^\d/) { @@ -126,20 +127,16 @@ sub heavy_export { last; } } elsif ($sym !~ s/^&// || !$export_cache->{$sym}) { - unless ($^S) { - # If we are trying to trap import of non-existent - # symbols using eval, let's be silent for now and - # just croak in the end. - require Carp; - Carp::carp(qq["$sym" is not exported by the $pkg module]); - } + # accumulate the non-exports + push @carp, + qq["$sym" is not exported by the $pkg module\n]; $oops++; } } } if ($oops) { require Carp; - Carp::croak("Can't continue after import errors"); + Carp::croak("@{carp}Can't continue after import errors"); } } else { |