Re: Quoted and unquoted spilts

2003-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, Jamie Risk said: >How would I split, then push onto a list a variable length text string >with quoted portions (example following) so that a split keeps text >in quotes together. > > "keep me together" separate1 separate2 separate3 "keep me together too" >separate4 > >If the above were

Re: Quoted and unquoted spilts

2003-02-06 Thread Rob Dixon
Bob Showalter wrote: > Just for kicks, here's a way to do it using split(). Text::CSV_XS is > still recommended, as it can deal with unbalanced quotes, escaped > embedded quotes, etc. > > $ perl -le 'print for map { /"(.*)"/ ? $1 : split " ", $_ } split > /(".*?")/, q["keep me together" separate1 s

RE: Quoted and unquoted spilts

2003-02-06 Thread Bob Showalter
Bob Showalter wrote: > Jamie Risk wrote: > > How would I split, then push onto a list a variable length text > > string with quoted portions (example following) so that a split > > keeps text in quotes together. > > > > "keep me together" separate1 separate2 separate3 "keep me > > together too"

RE: Quoted and unquoted spilts

2003-02-06 Thread Bob Showalter
Jamie Risk wrote: > How would I split, then push onto a list a variable length text string > with quoted portions (example following) so that a split keeps text > in quotes together. > > "keep me together" separate1 separate2 separate3 "keep me together > too" separate4 > > If the above were p

Re: Quoted and unquoted spilts

2003-02-06 Thread Jamie Risk
Never mind, although perhaps someone can explain what "split(/''/)" is doing. It satisfies my needs, but I don't know why (emphasis on the '' bit between the / /). -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Quoted and unquoted spilts

2003-02-06 Thread Jamie Risk
How would I split, then push onto a list a variable length text string with quoted portions (example following) so that a split keeps text in quotes together. "keep me together" separate1 separate2 separate3 "keep me together too" separate4 If the above were parsed, I should like to see six sep