#!/usr/bin/perl
use HTML::TokeParser;
$p = HTML::TokeParser->new(shift||"test.lpml");

while (my $token = $p->get_tag("category")) {
    my $url = $token->[1]{name} . $token->[1]{type};
    my $chmodtoken=$p->get_tag("chmod");
    my $text = $p->get_trimmed_text("/chmod");
    print "CHMOD: $text\n";
    my $text = $p->get_trimmed_text("/category");
    print "$url\t$text\t".join(" ",@{$token->[2]})."\n";
}
