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 salva (Abbot)
on Sep 12, 2017 at 12:54 UTC ( #1199197=note: print w/replies, xml ) Need Help??


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

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
Tracing the script with Process Monitor shows that the system call becomes...
C:\Strawberry\perl\bin\perl.exe -E "say for @ARGV" 1 " 2
It seems that multi-arg system doesn't quote arguments that already have quotes... maybe some poor application of DWIM principles or a work-around for keeping compatibility with old scripts written before the automating quoting was introduced.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199197]
help
Chatterbox?
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
Sections?
Information?
Find Nodes?
Leftovers?
    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.

    Notices?