Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Why would a Perl script stop with no informatives?

by gmargo (Hermit)
on Dec 21, 2009 at 22:51 UTC ( [id://813772]=note: print w/replies, xml ) Need Help??


in reply to Why would a Perl script stop with no informatives?

What are the 5 bad pages? I'd be really curious to see if the HTML is so bad that it chokes up the parser.

You could also try the perl debugger.

Replies are listed 'Best First'.
Re^2: Why would a Perl script stop with no informatives?
by Anonymous Monk on Dec 22, 2009 at 01:09 UTC

    only have one at my fingertips:
    http://tinyurl/nvzfar

    It seems to be pretty straightforward... and the parse completes... both with HTML::TokeParser and WWW:Mechanize. The failure occurs some fixed amount of execution after the parse is finished. Even if just stacking meaningless prints, it fails... (only tested in Mechanize)

    Let me say this again: after this loop:

    foreach my $link (@links) { print "LINK: " . $link->url() . "\n" if ($DEBUG>=1); push(@anchors,$link->url()); } my $goodAnchors = 0; print " @ 1ANCLOOP\n" if ($DEBUG>=1); print " @ 2ANCLOOP\n" if ($DEBUG>=1); print " @ 3ANCLOOP\n" if ($DEBUG>=1); print " @ 4ANCLOOP\n" if ($DEBUG>=1); . . . print " @ 29ANCLOOP\n" if ($DEBUG>=1); print " @ 30ANCLOOP\n" if ($DEBUG>=1);
    it stops at "24ANCHLOOP" - 24 out of 30 meaningless print statements...

    BTW, I just replaced the link parsing code (used to use HTML::TokeParser) with WWW::Mechanize, and the same thing still happens, albeit at a slightly different place. Of course, the failure changes each time I add tracing prints... but is completely repeatable, down to the character it fails on in a print, if that's where it is failing.

      it stops at "24ANCHLOOP" - 24 out of 30 meaningless print statements..

      Not necessarily. Do you get the same result if you add $|=1;? You could be suffering from buffering.

        and the buffering might be hiding an informative error message.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://813772]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-03-29 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found