in reply to Re^3: map vs for\foreach.
in thread map vs for\foreach.

> If I use map, it is understood that there are to be no modifications to the original data set

I was meditating if map should be changed in this respect.

Questions:

The usual workaround is to copy $_, like in

DB<111> @b = map {my $x=$_; ++$x} @a => (2 .. 11) DB<112> @a => (1 .. 10)

Then again its pretty easy to replace ++$_ with $_+1 and s/x/y/ with s/x/y/r in current Perl versions.

Not sure if there are any modifying operators left without a non-modifying counterpart.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)

PS: Je suis Charlie!