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


in reply to Replacing single quotes to two single quotes inside map

Hello Anonymous Monk,

Try something like that:

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @in = ("Maria's", "Thano's"); my @out = map { s/'/"/g; $_ } @in; print Dumper \@out; __END__ $ perl test.pl $VAR1 = [ 'Maria"s', 'Thano"s' ];

Update: Got late in my post due to experimentation. Did not copied fellow Monk duff code. Just to avoid confusion.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!