perl-HTML-TagReader-1.11-alt3.1 P > @
, 0 5196f67fc7135cf140840f5bad120ac3c5eaabb8 D9\ iBE > 3
?
~ d " X @ D \ ` d s x
0 P
( P x
( E 8 L 9 h :
F G H I X Y \ ] 8 ^ b
I d
r e
w f
| C perl-HTML-TagReader 1.11 alt3.1 Perl extension module for reading html/sgml/xml files 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 HTML::TagReader;
my $p=new HTML::TagReader "file.html";
my @tag;
while(@tag = $p->gettag(1)){
if ($tag[0]=~/ href ?=/i){
$tag[0]=~s/ ?= ?/=/g;
print "line: $tag[1]: col: $tag[2]: $tag[0]\n";
}
}
Here is a program that will read a html file tag
wise:
use HTML::TagReader;
my $p=new HTML::TagReader "file.html";
my @tag;
while(@tag = $p->getbytoken(1)){
if ($tag[1] eq ""){
print "line: $tag[2]: col: $tag[2]: not a tag (some text), \"$tag[0]\"\n\n";
}else{
print "line: $tag[2]: col: $tag[2]: is a tag, $tag[0]\n\n";
}
} \P|viy.hasher.altlinux.org ALT ALT Linux Team perl Cronbuild Service