#!/usr/bin/env perl use Modern::Perl; use Regexp::Assemble; my @to_remove = qw( is an to for from ); my @strings = ( 'is that true', 'this is from presentation', 'to create', ); my $re = Regexp::Assemble->new->add(@to_remove); # say $re; # uncomment to see the regex it makes map { s/$re//g } @strings; # remove strings anywhere # map { s/\b$re\b//g } @strings; # or just remove whole words say for @strings;