#!perl use warnings; use strict; my $wordlist = 'wordlist.txt'; open (LIST, $wordlist) or die "\n Cannot open $wordlist: $!\n"; my @listofwords; while (<LIST>) { chomp; push @listofwords, $_; } print "There are " . scalar(@listofwords) . " words in $wordlist\n";
In reply to Re: Testing if a .txt file contains any data
by RonW
in thread Testing if a .txt file contains any data
by sigmaaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |