Good day dear friends,
i am new to the list - and my name is floo
i am new to Perl and new to MySQL too.
Well i want to use store a result of a parser job in a mysql-db: and i also want to use a MySQL-DB. Perhaps i should take Perl::DBI.
see the following code - and the output
!/usr/bin/perl
use strict; use warnings;
use HTML::TableExtract;
use YAML;
my $te = HTML::TableExtract->new( attribs => {
border => 0,
bgcolor => '#EFEFEF',
leftmargin => 15,
topmargin => 5,
});
$te->parse_file('kultus-bw.html');
my ($table) = $te->tables;
for my $row ( $table->rows ) {
cleanup(@$row);
print "@$row\n";
}
sub cleanup {
for ( @_ ) {
s/\s+//;
s/[\xa0 ]+\z//;
s/\s+/ /g;
}
}
Output
School: MyShool
Schultype: lycee
adresss: champs-elysee, 75000 Paris
Postbox: Keine Angabe
Telefon: 45 - 07361/680040
Fax: 07361/680040
E-Mail:
lycee@schools.fr
Internet: www.lycee-paris.fr
departement: Paris Rubaix
head of school: Bill Clinton
deputy: Ron Wood
number of pupils: 259
classes: 8
number of teachers: 22
region: paris-midi
gouvernment: the french center council
Hard to be too specific as my question is very general. I've retrieved pages using LWP and used TableExtract to extract data and now i want to store the output in a mysql-database. I haven't used Mech, but by all accounts it is simpler than LWP.
Well i want to use LWP - and i also want to use a MySQL-DB. Perhaps i should take Perl::DBI.
Well do not bear with me. I am a beginner when it cones to perl.
You see: The data is parsed; I now want to store this results in a database:
How do i do that.
Note - i have many pages of the above mentioned. So it is worth to do the storage with MySQL
Can you give me some hints how to do it with Perl and DBI
love to hear from you
Regards floo