Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm probably overlookin' something obvious in the POD, but I can't seem to find out how to get the post-parse string out of it without reaching into a private variable.

my $parser_object = HTML::Praser->new( ... ); #boring args omitted $parser_object->parse($my_string); return $parser_object->{_private}->{text}; #so icky

Looking at the POD, I can't see the way to return the string otherwise. The likely culprits like eof() return the parser object itself. Have I missed something obvious?

  • Comment on Get parsed string from HTML::Parser without reaching into private variables?
  • Download Code

Replies are listed 'Best First'.
Re: Get parsed string from HTML::Parser without reaching into private variables?
by Anonymous Monk on Apr 06, 2009 at 14:55 UTC

    Original poster here, I'd missed 56674 in my initial search (searched only for 'HTML::Parser string'). That node covers my exact situation.