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:
system "export CVSROOT=<cvs>"
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!