I normally hesitate to post my thoughts in such learned company, but here goes.
under Win32 perl test.pl QUICK=BROWN\ FOX JUMPED=OVER\ THE\ LAZY DOG produced an @ARGV of $ARGV[0] = 'QUICK=BROWN\\'; $ARGV[1] = 'FOX'; $ARGV[2] = 'JUMPED=OVER\\'; $ARGV[3] = 'THE\\'; $ARGV[4] = 'LAZY'; $ARGV[5] = 'DOG'; So to achieve the result required I tried my $line = join ' ', @ARGV; $line =~ s/\s(?=\S+=)/\t/g; @pairs = split(/\t/, $line); %defaults = map {/([^=]+) # everything up to the = sign into + $1 = # the = sign ((\S+\\\s)+ # all words followed by "\ " \S+) # word after the last "\ " /x?($1=>$2):()} @pairs; for ( keys %defaults) { print $_,"=",$defaults{$_},"\n"; }; which produced QUICK=BROWN\ FOX JUMPED=OVER\ THE\ LAZY
Ay_Bee
-_-_-_-_-_-_-_-_-_-_-_- My memory concerns me - but I forget why !!!

In reply to Re: Regular expression double grouping negation headache by Ay_Bee
in thread Regular expression double grouping negation headache by JayBonci

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.