Parameter quoting rules for the Windows command line are discussed at
http://stackoverflow.com/questions/7760545/cmd-escape-double-quotes-in-parameter

The Relevant one for this issue is:

Any double-quote directly following a closing quote is treated as (or as part of) plain unwrapped text that is adjacent to the double-quoted group, but only one double-quote:
"Tim says, ""Hi!""" will act as one parameter: Tim says, "Hi!"
You seem to want to send the 2 middle double-quotes as a part of one single parameter.
To do that, you need to escape (For the Windows cmd interpreter), the 2 middle quotes thus:
perl arg.pl "abc """""" xyz"
I cannot claim to understand how c manages to get access to, and interpret the parameters without the cmd interpreter's intervention.

Update:This link goes into depth to explain how WIndows command lines are processed. It answered my doubts on why the C code behaved differently:

The C/C++ compiler which compiles the program secretly adds extra code to the executable that retrieves and parses the command line to extract the parameters before calling WinMain (or main). Thus, for a C/C++ executable on Windows, the parameter parsing rules are determined by the C/C++ compiler that compiled the program.
and has this little gem:
The missing undocumented rule has to do with how doubledouble quotes ("") are handled:

Prior to 2008:
      If a closing " is followed immediately by another ", the 2nd " is accepted literally and added to the parameter.
After 2008
      A double quote encountered outside a double quoted block starts a double quoted block.
      A double quote encountered inside a double quoted block:
            * not followed by another double quote ends the double quoted block.
            * followed immediately by another double quote (e.g. ""), a single double quote is added to the output, and the double quoted block continues.

Anyway - I prefer fishmonger's answer below, which reflects the rule:
Use \" to insert a literal "

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams


In reply to Re: Parsing Windows CommandLine from Perl by NetWallah
in thread Parsing Windows CommandLine from Perl by eyepopslikeamosquito

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.