Are you Suffering from Buffering?

If there's no "\n" at the end of what you're printing, and you haven't messed with $|, there's a good chance that the issue with your screen output is simply that the output buffer isn't being flushed to the screen until the Perl script exits.

That could explain wonky output.

As for explaining away the fact that files and directories aren't getting created, that probably has more to do with the permissions under which your Perl script is being executed, while running as an external command within the .net framework. If your Perl script is executing commands that create directories and files, surely the return values of those commands would indicate failure if you check them, and if they do indicate failure, $! is going to give you some clues as to what's wrong. Make sure that all your system commands (open, close, etc.) are being checked for success, and upon failure, make sure to dump the results to a logfile. Or if you're unable to get a logfile to be written, dump errors to STDERR inside of a routine that awaits a "hit enter to continue" before proceeding, so you can see what's happening.

We'll have a hard time telling you for sure what's wrong without seeing the offending code, and without seeing the error messages it's generating. And if you're not testing for failure, you won't see the system call error messages either.


Dave


In reply to Re: Calling perl in C# by davido
in thread Calling perl in C# by joemaniaci

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.