vr has asked for the wisdom of the Perl Monks concerning the following question:
I thought Perl would take care of that for me.
On Linux:
~$ 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
But on Windows (no test for single quote, because irrelevant and works OK):
>perl -E "system $^X, '-E', 'say for @ARGV', 1, qq(\x22), 2" 1 2
So I have to do this:
>perl -E "system $^X, '-E', 'say for @ARGV', 1, qq(\\\x22), 2" 1 " 2
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?
|
---|