On Sun, 31 Oct 2010 20:29:27 +0100, Moritz Lenz <mor...@faui2k3.org> wrote:
If we can efficiently match against a lazy string, and if this doesn't
turn the lazy string into a (large) normal string, then the best way
to process a file might be something similar to:
my $fh = open ... err die;
my $contents = cat($fh.lines);
, followed by matching on $contents.
Better still would be to provide a way for filehandles to be directly
asked to produce a lazy Str which reflects the file.
I guess there's no good reason not to have a .Cat method in the IO class
- another thing that'll likely appear when Cats are implemented.
What if a regexp may consider a lazy list of string as a single lazy
string?
i have no idea exactly what does could mean in practice, but i would like
to see something like:
MyGrammar.parse($fh.lines);
or better:
MyGrammar.parse($io); # which could be a file or a socket
--
Oha