Leser: 1
4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/bin/perl
use strict;
use warnings;
use HTML::Parser;
my $string = qq~.:<script>text</script> .:<script>text34</script> <div class="bbcode">sammler schrieb:</div>~;
my $p = HTML::Parser->new();
$p->handler(start => \&start_handler,"tagname,self");
$p->parse($string);
sub start_handler{
return if(shift ne 'script');
my $self = shift;
my $text;
$self->handler(text => sub{$text = shift;},"dtext");
$self->handler(end => sub{print $text,"\n\n" if(shift eq 'script')},"tagname");
}
4 Einträge, 1 Seite |