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/AutoSplit.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/AutoSplit.pm')
-rw-r--r-- | lib/AutoSplit.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm index e021e0fffd..bf0f9256c8 100644 --- a/lib/AutoSplit.pm +++ b/lib/AutoSplit.pm @@ -3,7 +3,6 @@ package AutoSplit; use 5.006_001; use Exporter (); use Config qw(%Config); -use Carp qw(carp); use File::Basename (); use File::Path qw(mkpath); use File::Spec::Functions qw(curdir catfile catdir); @@ -11,7 +10,7 @@ use strict; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Verbose, $Keep, $Maxlen, $CheckForAutoloader, $CheckModTime); -$VERSION = "1.04"; +$VERSION = "1.04_01"; @ISA = qw(Exporter); @EXPORT = qw(&autosplit &autosplit_lib_modules); @EXPORT_OK = qw($Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime); @@ -168,6 +167,10 @@ sub autosplit{ autosplit_file($file, $autodir, $keep, $ckal, $ckmt); } +sub carp{ + require Carp; + goto &Carp::carp; +} # This function is used during perl building/installation # ./miniperl -e 'use AutoSplit; autosplit_lib_modules(@ARGV)' ... @@ -405,14 +408,14 @@ EOT print " deleting $file\n" if ($Verbose>=2); my($deleted,$thistime); # catch all versions on VMS do { $deleted += ($thistime = unlink $file) } while ($thistime); - carp "Unable to delete $file: $!" unless $deleted; + carp ("Unable to delete $file: $!") unless $deleted; } closedir($outdir); } } open(my $ts,">$al_idx_file") or - carp "AutoSplit: unable to create timestamp file ($al_idx_file): $!"; + carp ("AutoSplit: unable to create timestamp file ($al_idx_file): $!"); print $ts "# Index created by AutoSplit for $filename\n"; print $ts "# (file acts as timestamp)\n"; $last_package = ''; |