I meant don't generate the Perl code from the C code. Save the perl script in a file, put it some place where it can be run, and run it with a similar command line but passing the username or password as arguments. This will make it much easier to maintain and test the Perl script.
Is the C process continually running and it sometimes fails in the same execution of the C process? Is there anywhere else in the code where the C program gets forked, or changes the environment?
Do you have multiple perl installations? Is there any possibility it could be running different ones if the PATH changes? It is suspicious that there are two different sets of directories in the library list. Try specifying the full path to the perl program you want to use.
Other things to try are printing out the command before running. Save the perl scripts and try running them manually with different environments. Compare the perl scripts to see if they are different for failing and successful execution. Print out the environment before running the command.
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.