Text-ASCIIPipe
view release on metacpan or search on metacpan
lib/Text/ASCIIPipe.pm view on Meta::CPAN
# The hooks are methods of the above!
# (or just any sub that wants it as first argument)
,begin => \&begin_hook
,line => \&line_hook
,end => \&end_hook
,allend => \&allend_hook
);
=head1 DESCRIPTION
A lot of the speed penalty of Perl when processing multiple smallish data sets from/to text form in a shell loop consists of the repeated perl compiler startup / script compilation, which accumulates when looping over a set of files. This process can...
When dealing with ASCII-based text files (or UTF-8, if you please), there are some control characters that just make sense for pushing several files as a stream, separated by these characters. These are character codes 2 (STX, start of text), 3 (EOT,...
All this module does is provide a wrapper for inserting these control characters for the sender and parsing them for the receiver. Nothing fancy, really. I just got fed up writing the same loop over and over again. It works with all textual data that...
The process() function itself tries to employ a bit of smartness regarding buffering of the output. Since the actual operation of multiple ASCIIPipe-using programs in a, well, pipe, might conflict with the default buffering of the output stream (STDO...
The callback hooks get handed in the optional configured handle and, as primary argument, the current line to process. Also, the current line end is given as following argument to help constructing additional lines properly, if you wish to do so:
sub hook
{
( run in 0.478 second using v1.01-cache-2.11-cpan-4d50c553e7e )