in reply to Using the contents of
The documentation says that alternatively to
$p = HTML::TokeParser->new( $filename, %opt ); [download]
$p = HTML::TokeParser->new( \$document, %opt ); [download]
Which is what I'd use then.