in reply to Re: stuck at "Use of uninitialized value in length at ..."
in thread stuck at "Use of uninitialized value in length at ..."

You may want to use the foreach keyword:

In general, that's a good solution. In this case, you'd end up with

my @all_words = <FH1> ; foreach (@all_words) {
which is a needless waste of memory. The following is much more appropriate:
while (<FH1>) {
which is short for
while (defined($_ = <FH1>)) {