ashish srivastava wrote:

>> Hi,
>>
>> Is there a method by which we can permanently define an env variable
>> from a perl script? I mean i define a variable and set its value in a
>> script. And i can access the variable even if i quit the script?


No.  Because the script is running as a child of the shell (or webserver
or whatever) and can't affect the parent's environment (unless the parent
were to supply a mechanism to do so [I know of no such mech]).  It could
be done if the parent can be coded to support it.


>> I have tried using the system("setenv VAR var_value"); but this dosent work.
>>
>> #!/local/bin/perl -w
>>
>> print "Before setting ".$ENV{'VAR1'},"\n";
>> system("setenv VAR1 Ashish");
>> print "After Setting ".$ENV{'VAR1'},"\n";
>> ## this just sets the variable as long as the script is running ##
>> $ENV{'VAR1'}="Ashish";
>> $e1=$ENV{'VAR1'};
>> print "Env Variale is $e1\n";
>> ##
>>
>> Any pointers?


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to