summaryrefslogtreecommitdiff
path: root/lib/Exporter.pm
diff options
context:
space:
mode:
authorM.J.T. Guy <mjtg@cus.cam.ac.uk>1997-06-13 16:08:45 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commit3bb63ce62db2f3ee2964b123e979675f768f552c (patch)
tree598642d4b3db7999f6573dd11b8ba57e7c295bb2 /lib/Exporter.pm
parentc3648e425c350dcf59c21e3ddc986e4c765acd1b (diff)
downloadperl-3bb63ce62db2f3ee2964b123e979675f768f552c.tar.gz
Exporter errors give wrong location
If you attempt to import a symbol which a module doesn't export, the error is reported as in Exporter.pm rather than in the offending module, because Exporter.pm uses warn instead of carp. Patch attached. (Against either 5.004 or 5.004_01.) p5p-msgid: E0wdJra-0000n8-00@taurus.cus.cam.ac.uk
Diffstat (limited to 'lib/Exporter.pm')
-rw-r--r--lib/Exporter.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Exporter.pm b/lib/Exporter.pm
index 66459b8af0..a91014bbde 100644
--- a/lib/Exporter.pm
+++ b/lib/Exporter.pm
@@ -108,7 +108,8 @@ sub export {
last;
}
} elsif ($sym !~ s/^&// || !$exports{$sym}) {
- warn qq["$sym" is not exported by the $pkg module];
+ require Carp;
+ Carp::carp(qq["$sym" is not exported by the $pkg module]);
$oops++;
}
}
@@ -137,8 +138,9 @@ sub export {
if (@failed) {
@failed = $pkg->export_fail(@failed);
foreach $sym (@failed) {
- warn qq["$sym" is not implemented by the $pkg module ],
- "on this architecture";
+ require Carp;
+ Carp::carp(qq["$sym" is not implemented by the $pkg module ],
+ "on this architecture");
}
if (@failed) {
require Carp;