----- Original Message ----- From: "Wong, Danny H." <[EMAIL PROTECTED]> To: "stuart arnold" <[EMAIL PROTECTED]>; "Sisyphus" <[EMAIL PROTECTED]>; "khozaima shakir" <[EMAIL PROTECTED]>; <perl-win32-users@listserv.ActiveState.com> Sent: Sunday, November 05, 2006 5:54 PM Subject: RE: Expanding environment variables
> The file is a text file ( configuration files ), not a Perl script file. > Just a text file containing line of variable=value and the Perl script > will read and parse the line and create environment variables out of > them. > > Config.txt > DB_ID="tst" > # > # > MODIFIED_TIME=-3:0:0:0 > # > CREATEDINQUALIFIER=created_in=$ENV{'LOCAL_DB_ID'} I assume that either: 1) You mean that the first line is LOCAL_DB_ID="tst" or; 2) You mean that the last line I've quoted above is CREATEDINQUALIFIER=created_in=$ENV{'DB_ID'} What was wrong with using string eval (as suggested by $Bill) ? ------------------------------ use warnings; use strict; my @strings = ("\$ENV{'LOCAL_DB_ID'}=\"tst\"", "\$ENV{'CREATEDINQUALIFIER'} = \"created_in=\$ENV{'LOCAL_DB_ID'}\""); for(@strings) {print $_, "\n"} print "\n"; for(@strings) {eval "$_"}; print $ENV{'LOCAL_DB_ID'}, "\n", $ENV{'CREATEDINQUALIFIER'}, "\n"; ----------------------------- Cheers, Rob _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs