count how many tags

2005-08-31 Thread Adriano Allora
dear all, I didn't understand how to use the module HTML, but I need to count how many tags of several types appear in a web page and so I wrote this script. Someone can tell me why this one doesn't work? %tags = ("paragraph" => "p", "list_o" => "ol", "list_no" => "ul",

Re: count how many tags

2005-08-31 Thread Adriano Allora
well, the name of the sub is correct. I translated it and I add an error only in my e-mail. alladr while(<$filename>) { foreach $var (keys(%tags)) { $$var += count_it($$var, $var, $tags{$var},$_); } } foreach $va

Re: count how many tags

2005-08-31 Thread Ovid
--- Adriano Allora <[EMAIL PROTECTED]> wrote: > I didn't understand how to use the module HTML, but I need to count > how > many tags of several types appear in a web page and so I wrote this > script. > > Someone can tell me why this one doesn't work? > > %tags = ("paragraph" => "p", >

Re: count how many tags

2005-08-31 Thread Ovid
--- Ovid <[EMAIL PROTECTED]> wrote: > First, I would suggest that you're trying to count two different > things, tags and attributes. You may wish to separate them. The > following code will do what you want. It uses the > HTML::TokeParser::Simple module to make this relatively easy to read