![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re^4: Comparing lines of multiple filesby Tortue (Scribe) |
on Oct 11, 2005 at 11:02 UTC ( #499106=note: print w/replies, xml ) | Need Help?? |
Here's a first pass at cleaning up the main loop of your code. It's not tested, so don't trust it, but it ought to do exactly the same thing, faster.
The code is easier to read this way. So easy that I can see a BUG! (I left it in with a comment). The program could be made even clearer and further optimized, but this is a start. For example you can replace all the print DAT $c; with $all .= $c; and, wait till the end to open the file for append, print DAT $all;, and close. By the way, if you can, you should test this in a standalone program on your computer, not just on the web.
In Section
Seekers of Perl Wisdom
|
|