(.*?)) {
my $utf8 = decode_entities($1);
$utf8 = uc($utf8); utf8::encode($utf8);
printf "%-12.12s\t", $utf8;
$state = TIME1;
}
}
when ($state == TIME1) {
if ($line =~ /class="time">(.*?)) {
print $1, " ";
$state = PROG1;
}
}
when ($state == PROG1) {
if ($line =~ /| /) {
# next line has title
$line = shift @html;
$line =~ /title="Programmadetail: (.*?)">(.*?)<\/a>/;
my $utf8 = decode_entities($1);
utf8::encode($utf8);
printf "%-20.20s\t", $utf8;
$state = TIME2;
}
}
when ($state == TIME2) {
if ($line =~ /class="time">(.*?)) {
print $1, " ";
$state = PROG2;
}
}
when ($state == PROG2) {
if ($line =~ / | /) {
# next line has title
$line = shift @html;
$line =~ /title="Programmadetail: (.*?)">(.*?)<\/a>/;
my $utf8 = decode_entities($1);
utf8::encode($utf8);
printf "%-20.20s\n", $utf8;
$state = CHANNEL;
}
}
}
}
|