I am getting undefined errors while using HTML::TokeParser.
print $agent->content();
my $stream = HTML::TokeParser->new($agent->{content});
line 1 - I do get desired output from my print statement.
line 2 - Error: Use of uninitialized value $stream in print.
No clue why it could not be working?
A scalar argument to the
HTML::TokeParserconstructor is treated as a filename or filehandle, and failure to open the file will cause the constructor to returnundefand set$!.If you want to pass the actual HTML to the constructor, you have to use a scalar reference: