can your wrapper just be something like this? i.e. does it really need to figure out the final directory during or can it wait until after?
#!/bin/bash out=/tmp/wrapper.$$ perl some_script.pl > $out 2>&1 # run your script, trapping everythin +g dest=`perl -x $0 $out` # examine logfile, figure out right place mkdir -p ${dest%/*} # make sure the directory exists mv $out $dest # move the log into place exit ############################### #!/usr/bin/perl use strict; use warnings; my $filename = $ARGV[0]; my $output; # read in $file, figure out where it should go; set $output print $output;
(note that the perl code could also use File::Copy's move() as well; and also note that the bash script could check the exit code of the perl call;)

Update: Hmm.. re-reading OP, i see "some file on the shared disk that everything else is put into" .. So i guess the mv should be an append .. and i guess my main question gets re-phrased as "do you need to append as you go (interlacing w/other logs) or can it append as one big chunk at the end?

In reply to Re: Delayed-write object/module by davidrw
in thread Delayed-write object/module by Tanktalus

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.