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