#!/usr/bin/env perl use strict; use warnings; my @del_words = qw{is an to for from}; my $del_words_alt = join q{|} => @del_words; my $del_re = qr{\b(?>$del_words_alt)\b\s*}; while (<>) { s{$del_re}{}g; print; } #### $ pm_string_array_del.pl is that true that true this is from presentation this presentation to create create