in reply to Comparing arrays

Note: This is a reply to the UPDATED code added to the original post.

A few quick observations:

my @wordlist = $line; #split/\t/, $line;

The split is needed here. As it is, this just assigns the whole line to $wordlist[0].

if ($token =~ /('?\w+)/)

This regular expression needs to be written as a character class, and suitably quantified:

if ($token =~ /(['\-\w]+)/)

See http://perldoc.perl.org/perlre.html and http://perldoc.perl.org/perlretut.html.

my $existingfalsefriend; $existingfalsefriend{$searchword}++;

The second statement assigns to the hash %existingfalsefriend which was declared above. The first statement declares a scalar variable which happens to have the same name but is otherwise unrelated to the hash variable. So, in this context, the first statement does nothing and is unnecessary.

If, after fixing your code, you need further help, I suggest you:

This will make it easier for the monks to help you.

HTH,

Athanasius <°(((><contra mundum