open(LIST, ">wordlist.txt"); while (<>) { length($_) >= 5 or next; s/(\W|[1-9])//g; $i++; print LIST "$_\n"; } close(LIST); print "$i words found. Saved in wordlist.txt\n";