http://www.perlmonks.org?node_id=435646


in reply to Re^2: Perl oddities (s/// doesn't DWIM in map)
in thread Perl oddities

my @new = map { local $_ = $_; s/foo/bar/; $_ } @old; also avoids the problem. Probably faster than using two maps, too. Still ugly, unfortunately.