|
NAMEText::Pipe - Common text filter APISYNOPSISmy $pipe = Text::Pipe->new('List::First', code => { $_ < 7 }); my $result = $pipe->filter('foo'); # or use Web::Scraper; my $scraper = scraper { process '//p/a', 'texts[]' => [ 'TEXT', PIPE('Trim'), PIPE('Uppercase') ]; }; DESCRIPTIONThis 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 or Web::Scraper. 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. With Web::Scraper, you can even use text pipes directly Using the "PIPE()" function, as shown in the synopsis. 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
METHODS
BUGS AND LIMITATIONSNo bugs have been reported.Please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. INSTALLATIONSee perlmodinstall for information and options on installing Perl modules.AVAILABILITYThe 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/>.The development version lives at <http://github.com/hanekomu/text-pipe/>. Instead of sending patches, please fork this project using the standard git and github infrastructure. AUTHORSMarcel Grünauer, "<marcel@cpan.org>"COPYRIGHT AND LICENSECopyright 2007-2009 by the authors.This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |