Ziv!
Evo, se enkrat imam to vprasanje...
Najprej
recem:
#!/usr/bin/perl -w
use HTML::Parser;
use strict;
use
diagnostics;
Potem pa:
my $count =
1;
while(<FILE>)
{
my $main_line = $_;
my
@line = split(/\t/,$main_line); # delimit the line
my
$fullhtml = $line[12];
my @tags; # ce ne dam
tegale notri, zajavka da zahteva explicit package...
my
$p=HTML::Parser->new(start_h=>[\@tags,"text"],
end_h=>[\@tags,"text"]);
# Parserju povemo, da nas zanimajo
tako start (<>) kot end (</>) tagi, in da
# naj celoten
text taga shrani v polje @tags.
$p->parse($fullhtml);
# Elementi @tags so zdaj polja, ki
imajo vsako en element, zato moramo
# @tags se "splosciti".
@tags=map($_=$$_[0],@tags);
print "St. vrstice: $count. TAGI:
@tags\n";
# potem bi rad prestel vse img tage, vse
a href tage, itd... PROBLEM je, da je polje @tags PRAZNO. $fullhtml je
gotovo prava spremenljivka.
$count++;
}
Title:
- [ LUGOS-PROG ] Novi Lisa paketki. Rok Papez
- [ LUGOS-PROG ] HTML::Parser Matej Kovacic
- Re: [ LUGOS-PROG ] HTML::Parser Matija Grabnar
- RE: [ LUGOS-PROG ] HTML::Parser Matej Kovacic
- Matej Kovacic
