Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created May 28, 2009 10:27
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/119212 to your computer and use it in GitHub Desktop.
Save kyanny/119212 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use HTML::Parser;
use Data::Dumper;
my $p = HTML::Parser->new(
api_version => 3,
start_h => [\&start, 'self, tagname, attr, text'],
end_h => [\&end, 'self, tagname, attr, text'],
marked_sections => 1,
);
$p->parse_file('hoge.html');
sub start {
warn 'start';
warn Dumper \@_;
}
sub end {
warn 'end';
warn Dumper \@_;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment