http://www.perlmonks.org?node_id=112526


in reply to Local tests reveal no syntax error but...

Try placing your new code after:

my $words = $q->param('words');
instead of before since you want to use $words inside the if statement.