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) = @_; $cb->(${$input_string}); $cb->(); };
The first call on cb notifies Text::APL about the template chunk and second without arguments notifies Text::APL about EOF.
cb
The following sources are implemented:
$reader->(\$scalar); $reader->($filename); $reader->($filehandle); $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.
examples/
build
Build a reader.
To install Text::APL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::APL
CPAN shell
perl -MCPAN -e shell install Text::APL
For more information on module installation, please visit the detailed CPAN module installation guide.