in reply to Re^7: IPC::Open3 woes
in thread Re^4: IPC::Open3 woes

I want to use the conents of both those file handles after each loop, dump the contents into an output file and then make them empty and continue with the next iteration.

Replies are listed 'Best First'.
Re^9: IPC::Open3 woes
by Corion (Patriarch) on May 25, 2010 at 09:49 UTC

    So, why don't you just do that? Where exactly are you having problems? You can read from the file handles line by line and output each line as you've read it.

      The customer does not want to wait until the script executes on all the 4 million lines. He expects something to be logged after each line in the input file is processed.

        So, give the customer what he wants.

        This is not a code writing service. We are here to help people with their problems in Perl. We will not do your work for you. We expect you to show some effort and we also expect you to solve your problems yourself.

        You will need to restructure your loop a small bit, but I've already shown you what you need to change. If you are not up to this task, you will need to either hire somebody who is up to the task or you will need to tell your customer to hire somebody else who knows how to restructure the loop so that it pleases your customer.

        The customer does not want to wait

        I can safely say: if you're giving the customer a log line for every single one of 4 million lines of input, he's going to have to wait a lot longer. Because logging slows down an app enormously.