foreach my $word (@array) { $word =~ s/(\.|\?|\!)$//; } foreach my $word (@array) { print "$word\n"; }