Text::Split - Text splitting with fine-grained control
version 0.0013
$data = <<_END_ # Xyzzy # --- START qwerty 1 2 3 4 5 6 8 9 10 The end # abcdefghi jklmnop _END_ $split = Text::Split->new( data => ... )->find( qr/#\s*--- START/ ) ( $split, $content ) = $split->find( qr/ The end/, slurp => '[]' )
$content =
$content
# --- START qwerty 1 2 3 4 5 6 8 9 10 The end
Alternatively, with
( $split, $content ) = $split->find( qr/ The end/, slurp => '()' )
qwerty 1 2 3 4 5 6
With Text::Split, given a split in some text, you can access the text preceding and remaining the split. Consecutive splitting lets you slurp text from between splits (optionally including the text from the splits at either end).
This distribution is deprecated, and will be renamed to Text::Clip
Robert Krimen <robertkrimen@gmail.com>
This software is copyright (c) 2010 by Robert Krimen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Text::Split, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Split
CPAN shell
perl -MCPAN -e shell install Text::Split
For more information on module installation, please visit the detailed CPAN module installation guide.