Well, if the two files are not very big, and if the "download" script is fairly simple, it might look like the two files are being processed "at the same time", because the whole operation on each file takes a very small fraction of a second.
The foreach loop pretty much dictates that the two files are being done one at a time, in sequence. What evidence do you have that the two log files are being "updated simultaneously" (apart from the modification time on the files)?
If you want to see a delay between the updates of the two files, try putting a sleep call inside the foreach loop, right before or right after the system call.
Oh, and do you understand what the "&" is doing at the end of the command line you pass to system()? On a linux/unix box, that causes each command to be run "in the background"; the shell exits immediately, but the perl process that it runs keeps running until it finishes on its own. If you want to make sure the two iterations do not overlap in time, you have to get rid of the "&" at the end.
(update: one more thing -- you don't need the "\n" at the end of the command-line string you pass to system.)
In reply to Re: Process a file one by one.
by graff
in thread Process each file one by one.
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |