For a start, thanks for your help :->

I wasn't using "print `blah`;", so I tried that, but it hasn't made any difference.

The script I am writing is called by another Perl script, which expects my script to produce lines from web server logs (so lots and lots of output). My script calls another script which actually reads the web server logs and organises them chronologically, then outputs the lines to stdout.

What I need is for my script to "pass through" the stdout output from the script I call, and output it on it's own stdout.

So at the moment, I construct a command (as an array) from a number of variables concatenated together (and when I print this command without executing it, it looks correct), and then I was calling it using "system()", but I realised after looking in the Perl docs that system() will only return the exit code of the command it called, so that is obviously no use to me.

Then I found that calling a command using backticks apparently lets you see the output of the command, but I must still be doing something wrong, as it doesn't.

Drew


In reply to Re^2: lines written to stdout by a backtick command by oceanic
in thread lines written to stdout by a backtick command by oceanic

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.