use Regexp::Common qw /profanity/; while (<>) { /$RE{profanity}/ and print "Contains profanity\n"; } ... =head2 $RE{profanity} Returns a pattern matching words -- such as Carlin's "big seven"