This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
untodo the no-longer-failing todo test for rgs' patch
[perl5.git] / lib / importenv.pl
1 # This library is no longer being maintained, and is included for backward
2 # compatibility with Perl 4 programs which may require it.
3 # This legacy library is deprecated and will be removed in a future
4 # release of perl.
5
6 warn( "The 'importenv.pl' legacy library is deprecated and will be"
7       . " removed in the next major release of perl. Please use the"
8       . " Env::Export module (or similar) from CPAN instead." );
9
10 ;# This file, when interpreted, pulls the environment into normal variables.
11 ;# Usage:
12 ;#      require 'importenv.pl';
13 ;# or
14 ;#      #include <importenv.pl>
15
16 local($tmp,$key) = '';
17
18 foreach $key (keys(%ENV)) {
19     $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
20 }
21 eval $tmp;
22
23 1;