home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7480 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  1.1 KB

  1. Path: sparky!uunet!bcstec!galileo!meb4593
  2. From: meb4593@galileo.rtn.ca.boeing.com (Michael Bain)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: C comment parser?
  5. Message-ID: <1271@galileo.rtn.ca.boeing.com>
  6. Date: 16 Dec 92 22:50:10 GMT
  7. References: <1268@galileo.rtn.ca.boeing.com> <mcook.724208094@fendahl.dev.cdx.mot.com>
  8. Organization: Boeing Commercial Airplane Group, Seattle
  9. Lines: 25
  10.  
  11. mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
  12. >
  13. >Remember that RE's are maximally matched (in Perl, and most Unix tools).  If
  14. >$_ has two or more comments in it, that s/// is going to delete them all in
  15. >one swoop, and it'll also delete everything between the comments.
  16.  
  17. Hmm, I didn't know that (says the self-taught UNIX person that only read
  18. man pages, and the camel book).
  19.  
  20. >But RE's are really the way to go.  The if comment is very big, Perl will dump
  21. >core.  (I tried it.)
  22.  
  23. Yup, that happened with your RE.  Although slow, the function you gave
  24. me should work.  Thanks for your help.
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. -- 
  32. Michael Bain                                            (206) 234-6942
  33. Boeing Commercial Airplane Group           meb4593@icdfs.ca.boeing.com
  34. Seattle, WA 98124
  35.  
  36.