summaryrefslogtreecommitdiff
path: root/lib/Env.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@cc.hut.fi>1997-01-02 17:27:47 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-04 17:44:00 +1200
commit40da2db335c65d50d3bca886fcc7161ed72faf74 (patch)
tree7fa3e6ca078a9a52592d28bd05a7f99be1af6544 /lib/Env.pm
parent5377b7012ceb2c72202db969f3b51a017f9551a9 (diff)
downloadperl-40da2db335c65d50d3bca886fcc7161ed72faf74.tar.gz
Make libs clean under '-w'
Diffstat (limited to 'lib/Env.pm')
-rw-r--r--lib/Env.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Env.pm b/lib/Env.pm
index 63beb07508..1f06bebf24 100644
--- a/lib/Env.pm
+++ b/lib/Env.pm
@@ -47,7 +47,11 @@ sub import {
my ($callpack) = caller(0);
my $pack = shift;
my @vars = @_ ? @_ : keys(%ENV);
+ return unless @vars;
+ eval "package $callpack; use vars qw("
+ . join(' ', map { '$'.$_ } @vars) . ")";
+ die $@ if $@;
foreach (@vars) {
tie ${"${callpack}::$_"}, Env, $_ if /^[A-Za-z_]\w*$/;
}