p4raw-id: //depot/win32/perl@838
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, $_;
}
}