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/open.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/open.pm')
-rw-r--r-- | lib/open.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/open.pm b/lib/open.pm index 4515899461..35657623fa 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -1,9 +1,8 @@ package open; use warnings; -use Carp; $open::hint_bits = 0x20000; # HINT_LOCALIZE_HH -our $VERSION = '1.04'; +our $VERSION = '1.04_01'; require 5.008001; # for PerlIO::get_layers() @@ -14,6 +13,10 @@ sub _get_encname { return; } +sub croak { + require Carp; goto &Carp::croak; +} + sub _drop_oldenc { # If by the time we arrive here there already is at the top of the # perlio layer stack an encoding identical to what we would like @@ -39,13 +42,11 @@ sub _drop_oldenc { require Encode; my ($loname, $lcname) = _get_encname($old[-2]); unless (defined $lcname) { # Should we trust get_layers()? - require Carp; - Carp::croak("open: Unknown encoding '$loname'"); + croak("open: Unknown encoding '$loname'"); } my ($voname, $vcname) = _get_encname($new[-1]); unless (defined $vcname) { - require Carp; - Carp::croak("open: Unknown encoding '$voname'"); + croak("open: Unknown encoding '$voname'"); } if ($lcname eq $vcname) { binmode($h, ":pop"); # utf8 is part of the encoding layer |