diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-28 05:01:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-28 05:01:57 +0000 |
commit | dfb1c8b93631b1cf8c1d0d2295ffff2bf0f098a7 (patch) | |
tree | f329a9abc38f1c1a7386994906bd913f321c2a3a | |
parent | 422938c9d5058631f624543ce0a0ff702a6a67c0 (diff) | |
download | perl-dfb1c8b93631b1cf8c1d0d2295ffff2bf0f098a7.tar.gz |
[win32] fix Env.pm to weed out illegal names
p4raw-id: //depot/win32/perl@838
-rw-r--r-- | lib/Env.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Env.pm b/lib/Env.pm index f2fe4af422..b0afc3b2db 100644 --- a/lib/Env.pm +++ b/lib/Env.pm @@ -45,14 +45,14 @@ Chip Salzenberg E<lt>F<chip@fin.uucp>E<gt> sub import { my ($callpack) = caller(0); my $pack = shift; - my @vars = @_ ? @_ : keys(%ENV); + my @vars = grep /^[A-Za-z_]\w*$/, (@_ ? @_ : 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*$/; + tie ${"${callpack}::$_"}, Env, $_; } } |