[comp.lang.perl] split newbee question

harrison@csl.dl.nec.com (Mark Harrison) (05/02/91)

I would like to split fields on a line, following these constraints:

1.  Fields are whitespace separated words.  This is what I am doing
    now, with split("[ \t]+").  (Can be "optimized" to just "split"?

2.  Fields can have embedded whitespace if in quotes:

	first.field "second field" third-field

3.  Field can be double quoted, double quotes can appear in field
    if preceded by backslash:

		"one \"field\" with quotes"

Any hints appreciated...
-- 
Mark Harrison           | Note: harrison@ssd.dl.nec.com and
harrison@csl.dl.nec.com | necssd!harrison are not operating at
(214)518-5050           | present.  Please forward mail through the
                        | above address.  Sorry for the inconvenience.