开发者

Perl MozRepl cleanup problem

I'm coding a web crawler and I've been using WWW::Mechanize::Firefox to navigate some pages (for the others I use WWW::Mechanize) which keep loading content after the page loaded and I've never had an issue with that.

Yesterday I added DBI and DBD::mysql to the script, adding queries to export data to a database (this works pe开发者_JAVA技巧rfectly), but suddenly MozRepl started giving this error:

(in cleanup) Can't call method "execute" on an undefined value at /Library/Perl/5.10.0/MozRepl.pm line 372 during global destruction.
(in cleanup) Can't call method "execute" on an undefined value at /Library/Perl/5.10.0/MozRepl.pm line 372 during global destruction.

and terminating the script after 1 cycle (it should run until it gets to the end of a specific text file, which it doesn't).

I haven't touched anything from this part of the script (don't need to use the db with those pages), at least willingly. I checked with a file compare app and couldn't solve anything.

Posting the code could be tricky, it's pretty long and I have no idea where the problem may lie.

EDIT

Sometimes it also gives this error instead of the previous one:

(in cleanup) Can't call method "cmd" on an undefined value at /Library/Perl/5.10.0/MozRepl/Client.pm line 186 during global destruction.


This has nothing to do with DBI or DBD::mysql.The messages are nothing to worry about, but I admit they are unsightly.

The messages come as remaining Perl/Javascript objects get destroyed in an unordered way during Perl Global Destruction. If you want to avoid them, destroy your $mech object before quitting your application.

undef $mech;
# end of program

If the $mech object is released before the program gets shut down, the Perl/Javascript bridge can also shut down in an orderly fashion.

Also note that the preferred forum for questions about WWW::Mechanize::Firefox is http://perlmonks.org :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜