home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14715 < prev    next >
Encoding:
Text File  |  1992-12-15  |  709 b   |  31 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!s5!is1.is.morgan.com!is.morgan.com!holger
  3. From: holger@is.morgan.com (Holger Veith)
  4. Subject: PERL PARSING
  5. Message-ID: <1992Dec15.172048@is.morgan.com>
  6. Sender: news@is.morgan.com
  7. Nntp-Posting-Host: idr110
  8. Organization: Morgan Stanley - IS
  9. Date: Tue, 15 Dec 1992 22:20:48 GMT
  10. Lines: 19
  11.  
  12. What is the best way to parse a string within PERL where I would like it
  13. to behave sort of like ksh.
  14.  
  15. I have used the split command by splitting on white space, but I would
  16. like everything enclosed in quotes to be one string.
  17.  
  18. ie.
  19.  
  20. $x='please "help me split" this line';
  21.  
  22. ->  $a[1]='please'
  23.     $a[2]='help me split'
  24.     $a[3]='this'
  25.     $a[4]='line'
  26.  
  27.  
  28. Thank you,
  29.  
  30. Holger.
  31.