Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created July 14, 2009 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyanny/146757 to your computer and use it in GitHub Desktop.
Save kyanny/146757 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use HTML::TokeParser;
my $filename = shift or die;
my $p = HTML::TokeParser->new($filename);
my $html;
while (my $token = $p->get_token) {
if ($token->[0] eq 'S'
and $token->[1] eq 'a') {
# ;;
}
else {
if ($token->[0] eq 'T') {
$html .= $token->[1];
}
else {
$html .= $token->[-1];
}
}
}
print $html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment