note
ig
<p>Since you haven't shown the value of <c>@files</c> it is difficult to be certain what your program fragment does. You should examine (print them or use the debugger) the values of <c>@files</c> to ensure they are what they should be and what you think they are. If they are not, you will have to correct the code that sets <c>@files</c>.</p>
<p>If <c>@files</c> has reasonable values (i.e. simple file names, no wildcards, no shell metacharacters, etc.) then your program fragment looks like it will run your download script once for each file. What is it that makes you think that both log files are updated simultaneously? If it is that they have the same modification time, it may be that your program runs to completion within one second. If you want to ensure that the files are being processed at different times and that the log files will have different timestamps, you can add a delay to your loop:</p>
<c>
foreach (@files) {
print "processing \"$_\"\n";
system "perl download ../downloads/files_download/$_ 1>/tmp/$_.log 2>/dev/null &\n ";
sleep 5;
}
</c>
<p>If that doesn't resolve your problem, then you should look at your "download" program.</p>
793364
793364