File::Basename::dirname bugs
[p5sagit/p5-mst-13.2.git] / lib / Env.pm
index 0e79075..1f06beb 100644 (file)
@@ -39,7 +39,7 @@ the environment, assign it the undefined value
 
 =head1 AUTHOR
 
-Chip Salzenberg <chip@fin.uucp>
+Chip Salzenberg E<lt>F<chip@fin.uucp>E<gt>
 
 =cut
 
@@ -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*$/;
     }