I'm more of a Windows guy, but that /var/www/cgi-bin looks like it's a directory used by a web server. If so, there may be different permissions for that directory and the STDOUT of the script when running from that directory might not be STDOUT of the shell (i.e. it's expecting to be run via web browser request through the web server, in which case STDOUT is HTTP response back to requesting client browser). Also, you might want to double-check the permissions for the script file after copying it to that directory.

That's my initial thoughts. But like I said, I'm more familiar with Windows, which means I could be wrong.


In reply to Re: perl stdout and backtick execute by dasgar
in thread perl stdout and backtick execute by solarity

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.