@foo = qw/a b c d e f g/; map{ push @foo, 'h' if /^d$/ } @foo; print @foo, "\n";