Change 13556 by jhi@alpha on 2001/12/09 18:21:46
Instead of muting symbol export error if under eval,
delay the errors until the croak().
Affected files ...
.... //depot/perl/lib/Exporter/Heavy.pm#15 edit
Differences ...
==== //depot/perl/lib/Exporter/Heavy.pm#15 (text) ====
Index: perl/lib/Exporter/Heavy.pm
--- perl/lib/Exporter/Heavy.pm.~1~ Sun Dec 9 11:30:06 2001
+++ perl/lib/Exporter/Heavy.pm Sun Dec 9 11:30:06 2001
@@ -109,6 +109,7 @@
@imports = keys %imports;
}
+ my @carp;
foreach $sym (@imports) {
if (!$export_cache->{$sym}) {
if ($sym =~ m/^\d/) {
@@ -126,20 +127,16 @@
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 {
End of Patch.