Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Process a file one by one.

by ig (Vicar)
on Sep 04, 2009 at 05:46 UTC ( #793367=note: print w/ replies, xml ) Need Help??


in reply to Process each file one by one.

Since you haven't shown the value of @files it is difficult to be certain what your program fragment does. You should examine (print them or use the debugger) the values of @files 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 @files.

If @files 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:

foreach (@files) { print "processing \"$_\"\n"; system "perl download ../downloads/files_download/$_ 1>/tmp/$_.log + 2>/dev/null &\n "; sleep 5; }

If that doesn't resolve your problem, then you should look at your "download" program.


Comment on Re: Process a file one by one.
Select or Download Code
Re^2: Process a file one by one.
by vinoth.ree (Parson) on Sep 04, 2009 at 06:43 UTC

    I already checked the @files, its contains only the file names nothing else

      You've said that before and you were mistaken, you need to prove it.

        Please tell me what I need to prove,do u need the files names?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://793367]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-21 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (108 votes), past polls