perlquestion
vr
<p>I thought Perl would take care of that for me. </p>
<p></p>
<p>On Linux:</p>
<c>
~$ perl -E 'system $^X, "-E", "say for \@ARGV", 1, qq(\x27), 2'
1
'
2
~$ perl -E 'system $^X, "-E", "say for \@ARGV", 1, qq(\x22), 2'
1
"
2
</c>
<p>But on Windows (no test for single quote, because irrelevant and works OK):</p>
<c>
>perl -E "system $^X, '-E', 'say for @ARGV', 1, qq(\x22), 2"
1
2
</c>
<p>So I have to do this:</p>
<c>
>perl -E "system $^X, '-E', 'say for @ARGV', 1, qq(\\\x22), 2"
1
"
2
</c>
<p>What was the space character? Just wondering if this behaviour was some oversight on porters' side? Of course not much trouble to escape all '"' 's myself, once I know about it. Are there other known similar surprises to watch out for?</p>