sub is_blacklisted { my $string = $_[0]; for (@blacklist){ # add \b /i to re as required return 1 if ( $string =~ /$_/ ); } return 0; }