in reply to HTML::TokeParser help - parsing headlines
I believe you are on the right track. The first thing that I see that you are doing wrong is at the following line:
Since $filename is enclosed in single quotes it will not interpolate and you are thus looking for a file called literally $filename instead of the just created file called: 'temp.html'my $stream = HTML::TokeParser->new('$filename') || die "Couldn't read HTML file $filename: $!";
Second, you have:
But don't have use URI; at the top of your file. So the package/method is missing when you call it.print URI->new_abs($next[0][2]{'href'}, $filename), "\n";
Lastly, you have next Token;, but you don't have a label Token, and you realistically don't need the next their either as it will immediately go into the next loop whether or not the next is there.
Upon making these three changes i believe the code will work as you intend.-enlil
|
---|