in reply to escape each backslash of each array element

bplegend,
I assume that you pull the array in from somewhere else rather than as you put it in your code snippet
That is, when I tried your code above after adding warnings and strict. Perl complained that I was using a bareword because the "\'" after the c is translated as an escaped "'" and not the end of the variable.
Have you checked for any errors coming up?
It seems to work fine for me.
I tried;
#!/usr/bin/perl -w use strict; my @row; my $separator=','; open(INPUT,"< temp.txt") or die "could not open"; while(<INPUT>){ chomp; push @row,$_;}; foreach (@row) { s/(\\+)/$1$1/g; } print join($separator, @row); print "\n";
and got aa,bb,\\\\c\\c\\,d\\d
temp.txt contained
aa bb \\c\c\ d\d