I've read perlmonks a lot recently, but this is the first time I have ever posted here (Hooray for the lurkers!). I ran into a problem that has me kind of stumped. Basically, I am automating a build process for win2k in MS Embedded C++ using activestate perl, and I am having issues with multiple sets of quotation marks. Here's the relevant code:
my $proggie = '"C:\Program Files\Microsoft eMbedded Tools\Common\EVC\B +in\EVC.EXE"'; my $switch = ' /MAKE "Project - Win32 Debug"'; print $proggie . "\n"; system $proggie; print $proggie . $switch . "\n"; system $proggie . $switch; '"C:\Program Files\Microsoft eMbedded Tools\Common\EVC\Bin\EVC.EXE" /M +AKE "Project - Win32 Debug"';
The issue is in the last two lines (6 and 7). Line 4 starts up the program beautifully by itself, as expected. Line 5 prints out what I think system() should be sending to the command line. And line 6 returns this error: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Which of course has me baffled because I have not altered the path to $proggie in any way, I just added a switch with quotation marks. Line 7 returns the same error (It is what line 5 prints out, enclosed in backticks), but if I cut and paste the contents of line 7 (Ignoring the backticks of course) into the command line directly, it works beautifully. What the heck is going on? Is this a bug, or am I missing something? Ivar

In reply to Win32 System() Weirdness by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.