@main=("In to the wild" ,"The catcher in the rye") ; @filters=("the","in"); for $filter (@filters) { s/\Q$filter\E//ig for @main; } print "@main"; # to wild catcher rye