[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] How to parse quoted text?



> add telecom "856473" "Louis Chretien" "" "Administrator"
> What would be the best way to parse each item into a separate variable in
> Perl? I first tought of split, but split won't account for the quotes
> enclosing space (split would seperate between "Louis" and "Chretien")
> I thought of using a regular expression, but no pattern is obvious.

How about chopping the first and last quotes and splitting by " " ?
(quote-space-quote) like:
@record_items = split("\" \"",$lineofdata);
You can put back the quotes later if you really need to.

I had an unrelated question for the list.  I was wondering if anyone knew about
handling file uploading with MacPerl and Webstar.  CGI.pm gives many
errors, and cgi-lib.pl 2.14 gives an error about $ENV{CONTENT_TYPE}.
Both modules handle file uploading okay in unix.

Thankyou,
Doug Holton
dlh@cc.gatech.edu