No doubt a fancy regex will do the trick, but simpler in my mind would be Text::ParseWords' parse_line()...
my @chunks = parse_line(' ', 0, $line);
One thing to note, however, is parse_line() makes no distinction between single and double quotes, which may or may not work for you.
--k.
In reply to Re: split on spaces, except those within quotes?
by Kanji
in thread split on spaces, except those within quotes?
by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |