[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cons 2.1.2 issues
From: |
Tony Kolarik |
Subject: |
Re: cons 2.1.2 issues |
Date: |
Thu, 02 Nov 2000 17:25:35 -0500 |
Actually the code he posted used the
while (<SCAN>) {}
form shown in the doc.
If it is indeed called multiple times with that usage, it would be a bug
according
to the doc. The only QuickScan test (t0071.t ) I found in the test suite
doesn't
test using the file handle method.
-- Tony K.
Brad Garcia wrote:
> On Thu, 2 Nov 2000, Zachary Deretsky wrote:
>
> > 4. It would be nice if QuickScan interface could be changed to just filename
> > as a parameter. There are at least 2 problems now: the scanner is called too
> > many times and the filename of the scanned file is not available
> > for debugging.
>
> When you say "the scanner is called too many times", I am assuming that
> you are referring to the fact that it is called once per line for every
> file.
>
> Notice that within the scanner function itself, you can read multiple
> lines. You could read the entire file, in which case the scanner would
> be called only once per file.
>
> >From the documentation:
>
> The
> subroutine is called once for each line in the file, with
> $_ set to the current line. If the subroutine needs to
> look at additional lines, or, for that matter, the entire
> file, then it may read them itself, from the filehandle
> SCAN. It may also terminate the loop, if it knows that no
> further include information is available, by closing the
> filehandle.
>
> So the current implementation gives you the flexibility of coding it
> either way.
>
> Brad Garcia
>
> _______________________________________________
> address@hidden
> http://mail.gnu.org/mailman/listinfo/cons-discuss
> Cons URL: http://www.dsmit.com/cons/