foreach my $item (($name,$nerd,$noodle,$froodle,)) { # another brackets $item =~ s/$i_seek/ /g; }