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
In reply to Re: compare two text file line by line, how to optimise
by NetWallah
in thread compare two text file line by line, how to optimise
by thespirit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |