#!/usr/bin/perl -w
# HTML::TokeParser dumper
#
# quick & dirty code to print out TokeParser output
use strict;
use HTML::TokeParser;
use LWP::Simple;
print "Content-type: text/html\n\n";
my $filename = 'temp.html';
open FH, ">$filename";
print FH get("http://www.buchanie.co.uk/news.asp");
close FH;
my $stream = HTML::TokeParser->new($filename)
|| die "Couldn't read HTML file $filename: $!";
while(my $token = $stream->get_token) {
if ($token->[0] eq "S"){
print "Token:S 1:$token->[1]\n";
foreach my $key(keys %{$token->[2]}){
print "Key: $key Value: ${$token->[2]}{$key}\n";
}
print "3: @{$token->[3]}\n4: $token->[4]\n\n";
}
elsif ($token->[0] eq "E"){
print "Token:E 1:$token->[1] 2: $token->[2]\n\n";
}
elsif ($token->[0] eq "T"){
print "Token:T 1:$token->[1]\n\n";
}
elsif ($token->[0] eq "C"){
print "Token:C 1:$token->[1]\n\n";
}
elsif ($token->[0] eq "D"){
print "Token:D 1:$token->[1]\n\n";
}
else {print "Unknown token $token\n\n";}
}
Installing modules without root and shell
Win32 Printing
Win32 Printing
"Unexpected field value" error with WWW::Mechanize
Running gpg thru IPC, fileno problem
Problems with Tk::SplashScreen and Tk::Splash
how to check for keyboard input
Updating Tk window in real time
issues reading from serial port
PDF::API2 is confusing me to death..
Win32 Directory Sync/Briefcase
Module info viewer
RFC: Proposed tutorial - simple login script using CGI::Application
|