in reply to compare two text file line by line, how to optimise
To get you started in that direction:
* Use meaningful variable names
* Error check each file open by adding open(...) or die "Could not open <filename>:$!";
* Do not repeatedly loop over the same arrays
Do all necessary processing in a single loop over the array.
* Use appropriate data structures: Use a hash for word lookups .
* Use subroutines for repeated code.
In addition, for questions to PM, be clear on what the inputs, and expected outputs look like. Also, a clear problem statement, and a polite request would probably induce someone to write it for you, since we have seen that you have put effort into doing this.
"Think of how stupid the average person is, and realize half of them are stupider than that." - George Carlin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compare two text file line by line, how to optimise
by thespirit (Novice) on Feb 26, 2016 at 11:29 UTC | |
by NetWallah (Canon) on Feb 26, 2016 at 18:59 UTC |