in reply to quicker way to merge files?

Others have pointed out how to do the I/O and regexp more efficiently. I'm going to stick with the structure:

DATA is a horrible name to use a file handle because perl provides a semi-magic one with the same name. When I glanced and saw that, I immediately looked for a __DATA__ marker.

I don't like big "if" blocks with no else. I think something like  next unless ( $line =~ m/..../ ); is easier to read.

Also, the formatting could be better. Four closing bracers on the same line make me think of the worst abuses in LISP.

- doug

Replies are listed 'Best First'.
Re^2: quicker way to merge files?
by GrandFather (Saint) on May 19, 2010 at 21:23 UTC

    The formatting at least may not be representative of the OP's original code. He chose to use br tags rather than wrapping the code in code tags and as we all know that doesn't provide for good control over formatting.

    True laziness is hard work