in reply to escape each backslash of each array element

Using the database driver escape functions as ikegami suggests is probably the best approach. In general though, trying to deal with backslashes usually makes my brain explode so I tend to utilise the hex representation instead. I find it vastly less confusing.

$ perl -E ' > @row = ( > q{aa}, > q{bb}, > qq{\x5c\x5cc\x5cc\x5c}, > qq{d\x5cd}, > ); > say qq{@row}; > s{\x5c}{\x5c\x5c}g for @row; > say qq{@row};' aa bb \\c\c\ d\d aa bb \\\\c\\c\\ d\\d $

I hope this is helpful.

Cheers,

JohnGG