Name : perl-HTML-TagReader
| |
Version : 1.10
| Vendor : gus_cpan_org
|
Release : 1.2
| Date : 2015-07-14 21:53:51
|
Group : Applications/CPAN
| Source RPM : perl-HTML-TagReader-1.10-1.2.src.rpm
|
Size : 0.30 MB
| |
Packager : Holger Manthey < holger_manthey_bertelsmann_de>
| |
Summary : HTML-TagReader - Perl extension module for reading html/sgml/xml files
|
Description :
The module implements a fast and small object oriented way of processing any kind of html/sgml/xml files by tag.
The getbytoken(0) is similar to while(< >) but instead of reading lines it reads tags or tags and text.
HTML::TagReader makes it easy to keep track of the line number in a file even though you are not reading the file by line. This important if you want to implement error messages about html errors in your code.
Here is a program that list all href tags in a html file together with line numbers and column:
use TagReader; my $p=new TagReader \"file.html\"; my AATTtag; while(AATTtag = $p->gettag(1)){ if ($tag[0]=~/ href ?=/i){ $tag[0]=~s/ ?= ?/=/g; print \"line: $tag[1]: col: $tag[2]: $tag[0]\ \"; } }
Here is a program that will read a html file tag wise:
use TagReader; my $p=new TagReader \"file.html\"; my AATTtag; while(AATTtag = $p->getbytoken(1)){ if ($tag[1] eq \"\"){ print \"line: $tag[2]: col: $tag[2]: not a tag (some text), \\\"$tag[0]\\\"\ \ \"; }else{ print \"line: $tag[2]: col: $tag[2]: is a tag, $tag[0]\ \ \"; } }
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/home:/csbuild:/Perl/RHEL_7/x86_64 |