chomp for @blocked; # don't expect to match newlines if ( grep { $FORM{'comments'} =~ /\b$_\b/ } @blocked) { ... }