html - Perl Can't call method "parse_html_string" or unbless reference -



html - Perl Can't call method "parse_html_string" or unbless reference -

i'm trying utilize module html::grabber parse html in perl. works when utilize in main process, throws me error when effort utilize threading.

specifically, got error,

thread 1 terminated abnormally: can't phone call method "parse_html_string" on unblessed reference @ /usr/local/activeperl-5.10/site/lib/html/grabber.pm line 79.

where creation of grabber object.

$mech->get($link); $dom = html::grabber->new(html => $mech->content); #at point

any thought how prepare weird problem?

the parse_html_string method called on xml::libxml parser object.

xml::libxml seems have mixed back upwards threads:

http://search.cpan.org/~shlomif/xml-libxml-1.78/libxml.pod#thread_support

what happening html::grabber creating parser object when imported script in main thread. create kid thread, , since xml::libxml not clone between threads, object disappears. need runtime load of html::grabber require in thread after spawned.

if not case, have boil downwards problem little illustration , post code here.

html perl parsing

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -