#!perl use warnings; use strict; my $wordlist = 'wordlist.txt'; open (LIST, $wordlist) or die "\n Cannot open $wordlist: $!\n"; my @listofwords; while () { chomp; push @listofwords, $_; } print "There are " . scalar(@listofwords) . " words in $wordlist\n";