$ perl -E ' > @arr = map { q{A} . do { chr 0x5c } x $_ . q{B} } 1 .. 4; > say for @arr;' A\B A\\B A\\\B A\\\\B $