xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/importenv.pl (revision 0:68f95e015346)
1*0Sstevel@tonic-gate;# $RCSfile: importenv.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:02 $
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate;# This file, when interpreted, pulls the environment into normal variables.
4*0Sstevel@tonic-gate;# Usage:
5*0Sstevel@tonic-gate;#	require 'importenv.pl';
6*0Sstevel@tonic-gate;# or
7*0Sstevel@tonic-gate;#	#include <importenv.pl>
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gatelocal($tmp,$key) = '';
10*0Sstevel@tonic-gate
11*0Sstevel@tonic-gateforeach $key (keys(%ENV)) {
12*0Sstevel@tonic-gate    $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
13*0Sstevel@tonic-gate}
14*0Sstevel@tonic-gateeval $tmp;
15*0Sstevel@tonic-gate
16*0Sstevel@tonic-gate1;
17