To see what's really happening behind the curtain, change an env variable -- it's called PERLSHELL or something like that, but it ignores the usual COMSPEC -- to point to a stub that just prints argv's in main. Might also call GetCommandLine (something like that, Win32 API call) to see what it looked like before the standard library parsed it into words, and see where your quotes (still) were.
I suspect that quotes may be getting lost.
It's working fine for me, with ActiveState build 628, with the line:
system '"C:\Program Files\Utilities\DskBench.exe" x y z' or die "$! $
+^E";
This is Win2K. Maybe Win9x w/Command.COM has problems, I don't know.
If all else fails, as a work-around use the short-name alias for the long directory names.
Hmm... playing around with it more, I found that it fails if there is another set of quotes!!
system '"C:\Program Files\Utilities\DskBench.exe" x y "foo z"' or die
+ "$! $^E";
fails as you note.
I have a dim memory of a case where I couldn't get system to work right, and ended up spitting out a batch file and running that.
It is clearly a bug somewhere in the system processing. If you do tests like I suggested above, you might find that the presense of more quotes makes them all stripped, or something like that.
—John
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.