Yes, there is solution. Please try:
exec perl -e '$ENV{TEST}="OK";exec $ENV{SHELL}'
Tested in bash and tcsh (hope should work everywhere).
Tomasz Kuczynski
[EMAIL PROTECTED]
> 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?
> 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?
>
> Thanks
> Ashish
>
>
>
>
>
>
> ------------------------------------------------------------
> Send flowers in 24 hours! At MSN Shopping.
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs