in reply to Comparing / Searching through Hashes

Welcome SayWhat?!,

Rather than debug your script for you, I hope I can make some suggestions for you to learn to better debug your scripts. Note: these are suggestions and after some years of doing your own debugging your suggestions could be very different than mine.

If your Perl supports it, use the 3 parameter version of open:

open (my $FALSEF, "<", "FalseFriendsList.txt");
I like how you name your files, and you can do the same with Perl variables, i.e.
my %ExistingFalseFriend; # or my %existing_false_friend; # or my %Existing_False_Friend;
This will help your eyes see exactly what you wanted to emphasize when you look at the code sometime in the future. Also, I define a $Debug variable that I set to the level of debugging
my $Debug = 3; # 0 - production, 1 - minor debugging, 2 .. 9 for + different levels

This leads to what is needed most in your script -- self-help debugging information. For example why not use a 'foreach' on the hash(or array) to see exactly what you just created.

#while the FF input exists while (my $line = <FALSEF> ) { # chomp off the new line chomp $line; # chomp could be part of while statement # increment $line $falsef{$line}++; } ### Now during debugging print to open log file if ( $Debug ) # this could be 'if ( 1==1 )' for testing, your + call { foreach my $key ( sort keys $falsef ) { print $LOG "$key\t$falsef{$key} } }
Now in your debug log file, you may see that you didn't initialize the hash the way you wanted. Again, my suggestion of 'foreach' could have been replaced by a print statement inside the 'while' loop.

In general, I like your style and I'm sure it will get better and better.

Good Luck...Your on your way!

"Well done is better than well said." - Benjamin Franklin