http://qs321.pair.com?node_id=1203148


in reply to Re^2: Replacing single quotes to two single quotes inside map
in thread Replacing single quotes to two single quotes inside map

The pros/cons are mostly about whether or not you need the original values of $data->{$_} elsewhere since the substitution operation will change the value in-place. If you require the original value prior to the change elsewhere in your code, then clearly you don't want to change them. tybalt89 gave a similar version where the value is returned and not changed, but it requires a relatively recent perl (>= 5.14). I didn't notice if you mentioned a perl version, but some unfortunate people are still on 5.10.1 and such.