home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6904 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.9 KB  |  41 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!chappell
  3. From: chappell@symcom.math.uiuc.edu (Glenn Chappell)
  4. Subject: Partial RegExp's
  5. Message-ID: <BxGFIy.LuA@news.cso.uiuc.edu>
  6. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  7. Reply-To: chappell@math.uiuc.edu (Glenn Chappell)
  8. Organization: Math Dept., University of Illinois at Urbana/Champaign
  9. Date: Mon, 9 Nov 1992 15:11:20 GMT
  10. Lines: 29
  11.  
  12. Here's a question I've been pondering for a few weeks:
  13.  
  14. Inherent in the design of Perl seems to be the idea that you always have
  15. enough space in memory for the entirety of any file you'd ever want to
  16. work on. But what if you don't? How does one do wonderful things like
  17. "split" and various pattern matches & such on files that are just too big?
  18.  
  19. Well, if there's already a standard, ok-I'll-spell-it-all-out-for-a-
  20. neophyte-like-you-but-next-time-read-the-book-okay answer to this
  21. question, I'd like to hear it. If, not, an idea:
  22.  
  23. Of course, the way you deal with huge files is to read them in chunks.
  24. The problem with that is that you miss a pattern match that starts on
  25. one chunk and ends on another.
  26.  
  27. Currently, the result of an attempt at a pattern match gives one of two
  28. responses: "Got a match" or "Didn't get a match". What if there were a
  29. way to tell the pattern matcher that some patterns may extend off the
  30. end of the currently available text, and we gave the matcher the ability
  31. to give two other reponses: "Got a partial match, and if you give me
  32. more data, I may get a match" and "Got a match, which may turn into a
  33. bigger match if you give me more data". The matcher would also return
  34. the place at which the partial match began.
  35.  
  36. Now, from what I know of pattern matching, it seems to me that this would
  37. be an easy modification to do. The question, then, is whether it would
  38. be worthwhile. So, does anyone think so? Or is it just me?
  39.  
  40.                 Glenn Chappell  <><
  41.