@restricted_words = qw ( funk shucks crud ); if (grep /$word/, @restricted_words){ print "wash your mouth out!\n"; }else{ print "Such a nice boy\n";}