push @foo, map {$_ eq 'd' ? 'd' : ()} @foo; print for @foo;