Click here to get back home

HTML::Pullparser error

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTML::Pullparser error Randall S Benson 04-04-2006
Posted by Randall S Benson on April 4, 2006, 5:15 am
Please log in for more thread options


I am currently writing a benchmark tester for a web application.
I send the first command, then gather the results, on the third time
around I parse the results to build the arguments for the next command.

sub parseQuerySchedule()
{
        my $wcontent = shift;
        my @FORM_TAGS = qw(input);
        my $names;
        my $string = "";
        my $found = 0;

        if (!defined($wcontent)){return $string;}
#        print "$wcontent\n";
        
        my $p = HTML::PullParser->new(
                                 $wcontent,
                                 start => 'tag, attr',
                                 end => 'tag',
                                 text => '@',
                                 report_tags => \@FORM_TAGS,
         )
         || die "$!";

        while ( defined( my $t = $p->get_token ) )
        {
                if ( $t->[0] eq "input" )
                {
                        $names = $t->[1];

                        #                print "the keys... ", sort keys %$names, "...\n";
                        if ( defined( $names ) )
                        {
                                if ( $names-> eq 'storeTrainInfo' )
                                {
                                        $found = 1;
                                        $string = buildShopAvailString( $names-> );
                                        return $string;
                                }
                        }

                }
        }
        if ( !$found )
        {
                lock $NOTRAINS;
                $NOTRAINS = 1;

        }
}

This works most of the times, but randomly the following error happens:

Odd number of elements in hash assignment at /usr/lib/perl5/HTML/PullParser.pm
line 14.
thread failed to start: Info not collected for any events at TWEtest.pl line 552
Use of uninitialized value in numeric gt (>) at TWEtest.pl line 151.
Use of uninitialized value in addition (+) at TWEtest.pl line 153.
Use of uninitialized value in addition (+) at TWEtest.pl line 155.
Use of uninitialized value in addition (+) at TWEtest.pl line 156.

Line 552 is the creation of the PullParser.

I thought it was incomplete HTML that was causing the problem, but dumping
it showed that the HTML was complete.

Anyone encounter this error, and if so, is there a solution?

perl version:
This is perl, v5.8.4 built for i386-linux-thread-multi



Similar ThreadsPosted
HTML::Parser error December 1, 2005, 8:31 am
Installation error for module in CentOS 5.0 for HTML::Mason June 18, 2007, 10:03 pm
[RFC] HTML::Dashboard (Spreadsheet-like formatting for HTML tables) April 16, 2007, 4:50 pm
Error: RCPT TO: error (550 relay not permitted) February 11, 2006, 1:39 pm
GD.c: 533: error: syntax error before "void" March 24, 2006, 10:15 am
HTML ---> PDF October 27, 2004, 2:13 am
HTML::TableExtract October 11, 2004, 9:30 pm
[RFC] HTML::FormatData May 13, 2005, 2:51 pm
[RFC] HTML::CheckArgs May 13, 2005, 2:49 pm
HTML::TableExtractor November 30, 2004, 6:42 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap