in reply to tokenize a string

If the rule is "no additional modules, please!", maybe the simplest (but, admittedly, very dirty way) is to loop over the individual characters of the string - kind of "good old C style" solution. That way it is easy to memorize whether or nor you are inside a quote. Note that you can easily get an array of the individual characters with split(//,$string).

A second possibility I could think of, would be using split(' ',$string), that means, you first pretend that you are not interested in handling the quotes correctly. This gives you an array of fields (some of them contain maybe only one quote), plus (because of the "magic" first argument to split some empty fields for the white spaces. Now you loop through this list. Whenever an element contains only one quote, you have to join it to the next element having a quote (and if the syntax of your string is correct, that element will also have exactly one quote). If you have in between empty elements, you have to treat them as spaces.

Having said this, I personally would prefer the former solution....

-- 
Ronald Fischer <ynnor@mm.st>