Вячеслав Тихановский
and 1 contributors


Text::APL::Reader - reader


Reads a template from various sources. Accepts a subroutine for a custom implementation.

Returns a reference to subroutine. When called accepts another reference to subroutine that is called upon receiving a chunk of the template.

For example a reader from a scalar reference is implemented as:

    $reader = sub {
        my ($cb) = @_;


The first call on cb notifies Text::APL about the template chunk and second without arguments notifies Text::APL about EOF.

The following sources are implemented:

    $reader->(sub {...custom code...});

Custom subroutines are used for non-blocking template reading. See examples/ directory for an example using IO::AIO for non-blocking template reading.



Build a reader.