Template::Extract::Run - Apply compiled regular expressions on documents
use Template::Extract::Run; use Data::Dumper; open FH, '<', 'stored_regex' or die $!; my $regex = join('', <FH>); close FH; my $document = << '.'; <html><head><title>Great links</title></head><body> <ul><li><A HREF="http://slashdot.org">News for nerds.</A>: A+ - nice. this text is ignored.</li> <li><A HREF="http://microsoft.com">Where do you want...</A>: Z! - yeah. this text is ignored, too.</li></ul> . print Data::Dumper::Dumper( Template::Extract::Run->new->run($regex, $document) );
This module applies a regular expression generated by Template::Extract::Compile to a document.
Constructor. Currently takes no parameters.
Applying $regex on $document and returning the resulting \%values. This process does not make use of the Template Toolkit or any other modules.
$regex
$document
\%values
Template::Extract, Template::Extract::Compile
Autrijus Tang <autrijus@autrijus.org>
Copyright 2004, 2005 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Template::Extract, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Extract
CPAN shell
perl -MCPAN -e shell install Template::Extract
For more information on module installation, please visit the detailed CPAN module installation guide.