Hi, if I understand your problem correct you want to change the default output location of scripts A,B,C,D to another directory, probably C:\Results and you want control that location from another script that coordinates all those script calls. Furthermore, you want to redirect STDERR from each script into one or more logfiles.

Seems, that you first need to check if scriptA-D allow to change their respective output-directories. If they don't support appropriate command line switches or environment variables, you might need to patch those scripts (they are all Perl - guessing that from the *.pl suffix, so you can edit them or create patched copies). You could use Getopt::Long to provide a new output directory via command line to scripts A,B,C,D. Then do something along system("...pathtoscript/scriptA.pl --dest-dir=$my_common_dest_dir 2>$my_common_log_fileA.log"). Check result of system. If you are already going to patch those scripts, you could also redirect STDERR from within these scripts (create i.e. a --log-stderr switch).
If these scripts output into a directory relative to where they were called, chdir and File::chdir might be something to investigate.

HTH (take this advice with a grain of salt/sugar/whatever since I do not use Perl under Windows that much...)


In reply to Re: Output redirection by Perlbotics
in thread Output redirection by Anonymous Monk

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.