in reply to Convert a string to an array?

Text::Balanced will help you grab the appropriate quoted strings, and the rest are pretty straightforward tokens. See the bit about extract_multiple() for an example. This may be enough for your needs, but matching the command line exactly can be difficult.

The Win32 CMD.EXE's command line parsing of arguments is pretty abysmal, but you should be able to replicate it if you consider the way it's implemented. Hint: split and regex may just get you into trouble unless you're careful. Grow an @ARGV one character at a time.

One thing that's in your favor is that you probably don't care about environment %variable% interpolation.

--
[ e d @ h a l l e y . c c ]