From: Gurusamy Sarathy Date: Sat, 28 Mar 1998 05:01:57 +0000 (+0000) Subject: [win32] fix Env.pm to weed out illegal names X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dfb1c8b93631b1cf8c1d0d2295ffff2bf0f098a7;p=p5sagit%2Fp5-mst-13.2.git [win32] fix Env.pm to weed out illegal names p4raw-id: //depot/win32/perl@838 --- diff --git a/lib/Env.pm b/lib/Env.pm index f2fe4af..b0afc3b 100644 --- a/lib/Env.pm +++ b/lib/Env.pm @@ -45,14 +45,14 @@ Chip Salzenberg EFE 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, $_; } }