NAME

Text::Pipe - Common text filter API

SYNOPSIS

my $pipe = Text::Pipe->new('List::First', code => { $_ < 7 });
my $result = $pipe->filter(...);

DESCRIPTION

This class is a factory for text pipes. A pipe has a filter() method through which input can pass. The input can be a string or a reference to an array of strings. Pipes can be stacked together using Text::Pipe::Stackable.

The problem that this distribution tries to solve is that there are several distributions on CPAN which use text filtering in some way or other, for example the Template Toolkit. But each distribution is somewhat different, and they have to reimplement the same text filters over and over again.

This distribution aims at offering a common text filter API. So if you want to use text pipes with Template Toolkit, you just need to write an adapter.

Text pipe segments live in the Text::Pipe:: namespace. So if you implement a Text::Pipe::Foo::Bar pipe segment, you can instantiate it with

my $pipe = Text::Pipe->new('Foo::Bar');

Some pipe segments take arguments. These are described in their respective class documentations.

EXPORTS

PIPE
my $pipe = PIPE('Reverse', times => 2, join => ' = ');
my $pipe = PIPE('UppercaseFirst');

Text::Pipe exports, on request, the function PIPE() that makes it easier to construct pipes. It takes the same arguments as new() and returns the corresponding pipe.

METHODS

TAGS

If you talk about this module in blogs, on del.icio.us or anywhere else, please use the textpipe tag.

VERSION

This document describes version 0.06 of Text::Pipe.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to <bug-text-pipe@rt.cpan.org>, or through the web interface at http://rt.cpan.org.

INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

AVAILABILITY

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.

AUTHOR

Marcel Grünauer, <marcel@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2007 by Marcel Grünauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.