|The stupid question is the question not asked
Set shell environment variables from within a perl scriptby reluctant_techie (Novice)
|on May 05, 2008 at 16:55 UTC
reluctant_techie has asked for the wisdom of the Perl Monks concerning the following question:
I am attempting to set a shell (bash) environment variable from within a Perl script but I have not been able to come up with a satisfactory solution. In particular, I am attempting to set the CVSROOT environment variable so that I can use the "system()" syntax to execute cvs commands. I had hoped the following syntax would work:
It does not.
Another solution would be to create a shell script on the fly which would contain a command to set the environment variable. My Perl script would then execute the shell script. This seems pretty messy.
Is there a better solution?
Thanks in advance!