Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Having to manually escape quote character in args to "system"?

by huck (Vicar)
on Sep 12, 2017 at 12:37 UTC ( #1199194=note: print w/replies, xml ) Need Help??


in reply to Having to manually escape quote character in args to "system"?

I think its about the windows cmd shell and its quoting needs.

These give me a good clue but i cant quite explain what i mean

perl -E "$,='|'; say $^X, '-E', 'say for @ARGV', 1, qq(\\\x22), 2" C:\Perl\bin\perl.exe|-E|say for @ARGV|1|\"|2
perl -E "$,='|'; say $^X, '-E', 'say for @ARGV', 1, qq(\x22), 2" C:\Perl\bin\perl.exe|-E|say for @ARGV|1|"|2
perl -E "say for @ARGV" 1 \" 2 1 " 2
perl -E "say for @ARGV" 1 " 2 1 2

In the last case I SUSPECT windows is seeing " 2 as a single arg with an unterminated quote and its terminating it for us

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199194]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2017-10-20 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?