On Sun, 10 Jun 2001, George Petri wrote:

> Then I did this (in Bash, Linux-Mandrake 7.2):
>
>       MYVARIABLE=astring
>       perl -e 'print $ENV{MYVARIABLE}, "\n";'
>
> It spits out nothing...why doesn't PERL detect any of my environment
> variables?  This is critical in some CGI programs that I intend to write (but
> haven't written yet :)).

You need to export the variable:

$ export MYVAR="string"
$ perl -e 'print "$ENV{MYVAR}\n"'
string
$

-- Brett

Reply via email to