my @without_oo = map { s/oo//rig } @with_oo; # traditional version: my @without_oo = map { (my $x = $_) =~ s/oo//ig; $x } @with_oo;