Using this code it will always print "File is loaded." regardless if there is any text in the file or not. I've also tried using -z and still get the same problem.
if(! -s $wordlist) {
print "File is empty\n";
exit 0;
} else {
print "File is loaded."
}