Hello again, SayWhat?!,
Good job on clarifying the question. I’m getting some idea of what you want to achieve. However, from your statement:
I want the matching lines to be written to OutputFalseFriends.txt, and the non-matching lines to be written to OutputUnsortedWorldList.txt
I would not expect the second output file to contain the line goed braaf, since this appears in both the input files. Is this a mistake, or am I missing something?
(Incidentally, a large part of ‘programming’ is really sorting out requirements, independently of the actual code. This is just something we all need to get used to.)
I think that, if you re-examine your code in light of your sample input, you will see that the requirements have evolved. For example, as RichardK observes, there are no commas, etc., to be cleaned up. Also, %hash is not being used for anything. Rather than fix your main loop — the loop beginning while (<BILWL>) — it will probably be easier if you re-think the logic of what you are doing and re-write this part from scratch.
flexvault has given some excellent advice. In addition, it will help you if you include the line:
use autodie;
near the top of your script, as this will tell you when files cannot be opened, etc. Also, if you:
use Data::Dumper;
this will make the debugging task easier. (Data::Dumper is a core module, so it will already be in your Perl installation. See http://perldoc.perl.org/Data/Dumper.html for details.) For example, you can print the contents of %falsef with just:
print Dumper(\%falsef);
You’re making progress!
Athanasius <°(((>< contra mundum
|