Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2018-03-23 09:06 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (289 votes). Check out past polls.