perl-5.6.1
HTML::Parser-3.26
Linux-2.4.16

I'm using the following script to GET an http page:

my $ua = LWP::UserAgent->new;
$ua->agent($some_ua);
my $req = HTTP::Request->new(GET => 'http://' . $some_site);
my $res = $ua->request($req);
my $code = $res->code

When run without any debugging information, the returned
code is 200. When run with ptkdb, code is 500. The reason
for this is probably that ptkdb changes the context of
expressions in order to gather debugging information.
Therefore, in the ignore_tags function of
HTML-Parser-3.26/Parser.xs, there should not be a croak if
not in void context. My proposed patch is at the end of this
message.

I'm not the first person to have had this problem, here's a
newsgroup posting dated Jul 18 2002 with the same problem:
http://groups.google.ca/groups?q=%22Can%27t+report+tag+lists+yet%22&hl=en&lr=&ie=UTF-8&selm=b5905300.0207181020.64540b6d%40posting.google.com&rnum=1

Please let me know if this patch can make it in the next
version of HTML::Parser,
Marc - Sitepak

diff -ruN old/Parser.xs new/Parser.xs
--- old/Parser.xs       Thu Aug 29 09:57:24 2002
+++ new/Parser.xs       Thu Aug 29 09:58:01 2002
@@ -355,8 +355,6 @@
        default:
            croak("Unknown tag-list attribute (%d)", ix);
        }
-       if (GIMME_V != G_VOID)
-           croak("Can't report tag lists yet");
 
        items--;  /* pstate */
        if (items) {

Reply via email to