Without seeing your error, why dont you do some testing with absolute paths. like:
system("source /home/perlmonkey/.profile").
For debugging purposes, I would suggest using the backtick approach to see any stdout:
print `source /home/perlmonkey/.profile`
Do note, your sourced profile will exist in the subshell you called it in. So to test it further you will have to do something like
print `source .profile;echo $PATH` which assumes that there exists a path var in the shell.
Hopefully your in some type of linux enviroment, otherwise the commands you were calling would be somewhat faulty.
UPDATE:Take a look at the answer in the following node
616002 as it addresses the problem of sourcing a license which could be quite similar to your problem.
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.