This is an advanced example.

It uses a file stream (Stream::ParrotIO) that is processed linewise with Stream::Lines. A counter stream creates line numbers, both are combined to one stream and then dumped.



Opens this file (or the one specified at the command line) and creates a lines stream for it. Then it combines the stream with a stream providing line numbers.


This sub is the source of the counter stream. It just endlessly writes line numbers followed by a space to its stream.


Jens Rieks <parrot at jensbeimsurfen dot de> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.


Copyright (c) 2004, the Perl Foundation.