NAME
Text::Pipe::List::First - Common text filter API
SYNOPSIS
my $pipe = Text::Pipe->new('List::First', code => { $_ < 7 });
my $result = $pipe->filter(...);
DESCRIPTION
Text::Pipe::List::First inherits from Text::Pipe::Base.
Methods inherited from Text::Pipe::Base:
new()
METHODS
- clear_code
-
$obj->clear_code;
Clears the value. =item code
my $value = $obj->code; $obj->code($value);
A basic getter/setter method. If called without an argument, it returns the value. If called with a single argument, it sets the value. =item code_clear
$obj->code_clear;
Clears the value.
- filter
-
If the input is an array reference, it passes each element to the code reference. The element will be in
$_
. Returns the first element for which the code reference returns a true value.If the input is a single string, it just returns that string. This is semantically correct - if there is only one string, it has to be the first one as well.
TAGS
If you talk about this module in blogs, on del.icio.us or anywhere else, please use the textpipe
tag.
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.