#!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"; if (@listofwords eq 0) { print "\n$wordlist contains nothing! \n"; exit 0 } else { print "\n$wordlist is loaded! \n"}