test
even more stuffincredible boat loads of stuff
an unbelievable quantity of
stuff!
Yo, dude!
test
even more stuff##
use File::Find;
use strict;
use HTML::TokeParser::Simple;
#my $new_folder = 'new_html/';
my @html_docs = "test5.html";
our $spancontents="";
my @files;
my $ByteCount=0;
my $filelist="";
my $isflagon=0;
my $idflag;
my %spancontents;
my $templatelocation;
my $currentdoc;
foreach my $doc ( @html_docs ) {
$currentdoc=$doc;
my $p = HTML::TokeParser::Simple->new( file => $doc );
while ( my $token = $p->get_token ) {
if ($token->is_start_tag('span') or $token->is_start_tag('div')) {
if ($token->get_attr('editable')=~/true/) {
$isflagon=1;
$idflag=$token->get_attr('id');
}
}
if ( ($token->is_start_tag('span') and $isflagon) .. $token->is_end_tag('span') and $isflagon){
my $text=$token->as_is;
$spancontents.=$text.",";
#next;
}
if ( ($token->is_start_tag('div') and $isflagon) .. $token->is_end_tag('div')){
my $text=$token->as_is;
$spancontents.=$text.",";
#next; #not sure if needed, seems to mess things up
}
if (($token->is_end_tag('span') or $token->is_end_tag('div')) and $isflagon) {
$isflagon=0;
#$spancontents.=$token->as_is.","; #not sure if needed, seems to mess things up
$spancontents{"$idflag"}.=$spancontents;
$spancontents="";
}
if ($token->is_start_tag('html')) {
my $attrs=$token->get_attr('templateref');
$templatelocation=$attrs;
}
}
}
print "\n\n\n";
foreach my $value (keys %spancontents) {
print "value is $value\n";
print "\nMy $value = $spancontents{$value} \n\n-------------------------\n";
}
####
value is anotherblock4
My anotherblock4 = ,an, unbelievable qua
ntity of
stuff!
,,
,,Yo, dude!,,
-------------------------
value is nvutest43
My nvutest43 = ,incredible boat loads of stuff
,,
,,
-------------------------
value is nvutest5
My nvutest5 = ,,more stuff,,
-------------------------
value is nvumaincontent
My nvumaincontent = ,stuff,,
-------------------------
value is nvu56
My nvu56 = ,even more stuff
,,
,,
-------------------------