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

That's because of the || ''. If the substitution returns false, i.e. there's no smart quote to substitute, you replace this return value that goes nowhere ("void context") by an empty string. You probably meant to add it into the assignment instead?
map { (my $dx = $data->{ $_ } || '') =~ s/’/'/g; $dx } @allparms

But that would replace 0's with empty strings. Use // to replace only undefs.

Update:

map { (my $dx = $data->{ $_ } // '') =~ s/’/'/g; $dx } @allparms
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^5: Replacing single quotes to two single quotes inside map
by Anonymous Monk on Nov 14, 2017 at 19:47 UTC
    You mean that this way:
    map { (my $dx = $data->{ $_ } || '') =~ s/’/'/g; $dx } @allparms

    Will not replace 0s with empty string, correct?