Path: utzoo!attcan!uunet!snorkelwacker!usc!elroy.jpl.nasa.gov!jarthur!nntp-server.caltech.edu!betwixt!adler From: adler@betwixt..caltech.edu (B. Thomas Adler) Newsgroups: comp.lang.perl Subject: Quoting and Splitting Message-ID: Date: 25 Sep 90 19:02:01 GMT Sender: news@nntp-server.caltech.edu Distribution: comp Organization: California Institute of Technology, Pasadena Lines: 23 Nntp-Posting-Host: betwixt.cs.caltech.edu Hi all, I've just run across a problem that I thought should have a natural solution (ie, a small one liner) in perl, but I can't seem to find it in the manual. I'm working on a program that parses the contents of a file (say, a nameserver file), and some of the fields are double-quoted, to preserve spacing. My question is, is there a way to have split() split on white-space, while respecting the restrictions imposed by any double quoting? ie, I'd like the line Field_1 parm_1 "This is example one" to split into three components, rather than 6. Any ideas? -Bo -- B. Thomas Adler <...!ames!elroy!cit-vax!adler>