Yes and no.
No, system does quote (in ActivePerl, at least).
@cmd = ( 'echo', 'identifier', 'a string', '"pre quoted"' );
system(@cmd); # identifier "a string" "pre quoted"
$cmd = "@cmd";
system($cmd); # identifier a string "pre quoted"
Yes, sending the command as a string instead of a list of arguments is a good idea in Windows. In Windows, command line parsing is done by the child. That means every program has its own mechanism to quote and escape its parameters (*). In turn, that means that system (or the underlying library) must guess at how the child wants its arguments quoted and escaped.
Avoid the guessing if possible and provide to the child what the child will receive.
* — If any! When quoting is supported, it's usually double quotes. As for an escaping mechanism, I don't remember ever seeing one, so good luck trying to pass a double quote to a program...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||