Greetings and hello, my dear friends!

This morning I finally ordered "Mastering Regular Expressions," so perhaps I can begin a less failure-riddled campaign in learning the uglies of Regular Expressions. It won't arrive for a week, though, so I wonder if soebody wouldn't mind fielding this one in the interim:

Let's say I have the following string:
$string = qq|Are "Perl Monks" required to swear an "Oath of Celibacy?" +|;
...and I need to break it down as such:
[0] Are [1] Perl Monks [2] required [3] to [4] swear [5] an [6] Oath of Celibacy?
It basically needs to be split on spaces, but keep quoted strings together. I'm sure there is an alarmingly simple solution which my unspeakable ignorance has caused me to overlook, and perhaps one of you could point it out in some embarrassing way. You'll have my gratitude, as always.

Alan "Hot Pastrami" Bellows
-Sitting calmly with scissors-

In reply to Another for those who love the Regular Expression questions... by Hot Pastrami

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.