diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1999-07-25 21:09:00 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-27 08:59:58 +0000 |
commit | e3d0cac0c3bf9ec77cb3e2fc362639f009d309e4 (patch) | |
tree | 337c2dbaadc3b48e57e882b4b678eecc53c92aec /configpm | |
parent | 538feb029e0f72a0968673b94ed4dca853d5473f (diff) | |
download | perl-e3d0cac0c3bf9ec77cb3e2fc362639f009d309e4.tar.gz |
decrease memory footprint of standard modules
Message-Id: <199907260509.BAA26303@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@3794
Diffstat (limited to 'configpm')
-rwxr-xr-x | configpm | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -19,13 +19,24 @@ my $glossary = $ARGV[1] || 'Porting/Glossary'; open CONFIG, ">$config_pm" or die "Can't open $config_pm: $!\n"; $myver = $]; -print CONFIG <<"ENDOFBEG"; +print CONFIG <<'ENDOFBEG_NOQ', <<"ENDOFBEG"; package Config; use Exporter (); -\@ISA = (Exporter); -\@EXPORT = qw(%Config); -\@EXPORT_OK = qw(myconfig config_sh config_vars); +@EXPORT = qw(%Config); +@EXPORT_OK = qw(myconfig config_sh config_vars); + +# Define our own import method to avoid pulling in the full Exporter: +sub import { + my $pkg = shift; + @_ = @EXPORT unless @_; + my @func = grep {$_ ne '%Config'} @_; + Exporter::import('Config', @func) if @func; + return if @func == @_; + my $callpkg = caller(0); + *{"$callpkg\::Config"} = \%Config; +} +ENDOFBEG_NOQ \$] == $myver or die "Perl lib version ($myver) doesn't match executable version (\$])"; |