Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 scrutinizing the Monastery: (6)
As of 2018-07-18 11:07 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (389 votes). Check out past polls.