Subject: | Don't import Carp into module by default |
Loading Carp into this module, only for the purposes of emitting an error is a little heavy. Could
I suggest this patch to pull it in only if mmap isn't available in the OS?
Subject: | patch.txt |
diff --git a/Mmap.pm b/Mmap.pm
index 21af4f8..f0f370c 100644
--- a/Mmap.pm
+++ b/Mmap.pm
@@ -180,7 +180,6 @@ compliant and contributed documentation as well.
=cut
use strict;
-use Carp;
use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
require DynaLoader;
require Exporter;
@@ -282,7 +281,8 @@ sub AUTOLOAD {
goto &AutoLoader::AUTOLOAD;
}
else {
- croak "Your vendor has not defined Mmap macro $constname";
+ require Carp;
+ Carp::croak("Your vendor has not defined Mmap macro $constname");
}
}
eval "sub $AUTOLOAD { $val }";
@@ -294,4 +294,3 @@ bootstrap Sys::Mmap $VERSION;
1;
__END__
-