use YAPE::HTML; use strict; my ($some_html,$p,$ext) = ("..."); $p = YAPE::HTML->new($some_html); $ext = $p->extract(a => ['href'], img => ['src']); while (my $tag = $ext->()) { # an tag with an HREF attribute, or # an tag with an SRC attribute } $ext = $p->extract(qr/^h[1-3]$/ => []); while (my $tag = $ext->()) { # an

,

, or

} #### use YAPE::HTML; use strict; my ($some_html,$p,$ext) = ("..."); $p = YAPE::HTML->new($some_html); while (my $chunk = $p->next) { if ($chunk->type('tag') and $chunk->tag('cs')) { print ""; } elsif ($chunk->type('closetag') and $chunk->tag('cs')) { print ""; } else { print $chunk->string } }