Hello!
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!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.