diff options
author | Tels <nospam-abuse@bloodgate.com> | 2005-07-02 16:11:46 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-07-02 16:11:46 +0000 |
commit | 8878f897ac9d9fa8a7f8ad4a14238341d36a293c (patch) | |
tree | f5466782bcd60aea629758a5cb7abfece8eca895 /lib/SelfLoader.pm | |
parent | 82bb6deb04ad3686538ac7e9262c77a8ab0aa822 (diff) | |
download | perl-8878f897ac9d9fa8a7f8ad4a14238341d36a293c.tar.gz |
do just-in-time loading of Carp.pm in some modules
Subject: [PATCH] No Carp #4 AutoSplit.pm
Subject: [PATCH] no Carp #5 (File::Path)
Subject: [PATCH] no Carp #7 - charnames.pm
Subject: [PATCH] no Carp #6 (File::Compare, File::Copy, File::Temp)
Subject: [PATCH] no Carp #8 - SelfLoader, Text/Balanced and open.pm
p4raw-id: //depot/perl@25052
Diffstat (limited to 'lib/SelfLoader.pm')
-rw-r--r-- | lib/SelfLoader.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 40c92db6b7..87587c31be 100644 --- a/lib/SelfLoader.pm +++ b/lib/SelfLoader.pm @@ -1,9 +1,8 @@ package SelfLoader; -# use Carp; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(AUTOLOAD); -$VERSION = "1.0904"; +$VERSION = "1.0905"; sub Version {$VERSION} $DEBUG = 0; @@ -18,6 +17,7 @@ our $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x; our $attr_list = qr{ \s* : \s* (?: $one_attr )* }x; sub croak { require Carp; goto &Carp::croak } +sub carp { require Carp; goto &Carp::carp } AUTOLOAD { print STDERR "SelfLoader::AUTOLOAD for $AUTOLOAD\n" if $DEBUG; @@ -115,7 +115,7 @@ sub _load_stubs { sub _add_to_cache { my($self,$fullname,$pack,$lines, $protoype) = @_; return () unless $fullname; - (require Carp), Carp::carp("Redefining sub $fullname") + carp("Redefining sub $fullname") if exists $Cache{$fullname}; $Cache{$fullname} = join('', "package $pack; ",@$lines); print STDERR "SelfLoader cached $fullname: $Cache{$fullname}" if $DEBUG; |