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:
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
Post a Comment