Re: HTML::Parser is not thread-safe

Father Chrysostomos <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
> In article <AC620479-1A75-4311-B2B0-0CBC9833B8D3[at]cpan.org>,
>  sprout[at]cpan.org (Father Chrysostomos) wrote:
> > It seems to work fine now, except that, if a Parser object is  
> created
> > within a thread *other than* the main thread, perl complains about
> > leaking scalars when the program exits.
> >
> > $ perl -MHTML::Parser -Mthreads -le'(async{new HTML::Parser})->join;
> > END { print "end" }'
> > end
> > Scalars leaked: 1
>
> However, perldoc threads says:
> > Returning objects from threads does not work.
>
> So don't do what you did in that example. :-)
>
>
> /Bo Lindbergh
>
I'm sorry. You're right. My example was badly written. If I put ";  
return" before the closing brace, it works.

Father Chrysostomos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.