----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, June 29, 2005 9:20 AM
Subject: Reading environment varible
> Dear Perlgurus,
>
> I've got a problem, reading an environment variable.
> My environemt: Windows XP/2000 Perl 5.6.. If possilbe, I don't want to
update to 5.8.
>
> First I start the following cmd file:
>
> --- begin ---
> SET FOO_TOKEN=BAR
> CALL SET %FOO_TOKEN%_DIR=c:bar
> --- end ---
>
> After that I start in the _same_ environment (cmd) the following perl
code:
>
> --- beginn ---
> use strict;
> use warnings;
>
> my $foo_token_dir = "%%FOO_TOKEN%_DIR%";
> my $foo_token_value = "";
>
> $foo_token_value = $ENV{ $foo_token_dir };
That should work, except that the variable you set is called
%FOO_TOKEN%_DIR, and the one you asked for is called %%FOO_TOKEN%_DIR%
(which is different and doesn't exist - hence the uninitialised value).
Cheers,
Rob
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs