Hello dear Community, good evening!

My first perl-parser runs very well - (thanks to the support of some friends here : Many many thanks to those who helped alot!). I was given lots of good hints and now i am ready and running a first parser with some great output!

BTW: Well i am very very glad to be here - this is a great place and i have a nice learning curve...This forums give me a great asset of learning!!

What is aimed now: i am parsing site with a small table

see here: http://www.schulministerium.nrw.de/BP/SchuleSuchen?action=799.601437941842&SchulAdresseMapDO=142359

Note: This page - and many others that are simmilar- is/are stored locally in the same folder as file t.html

Now i want to store the data in a MySQL-DB: i am figuring out how to do this:

Here the code:

#!/usr/bin/perl use strict; use warnings; use HTML::TableExtract; use YAML; my $te = HTML::TableExtract->new( attribs => { class => 'bp_ergebnis_tab_info' }, ); $te->parse_file('t.html'); foreach my $table ( $te->tables ) { foreach my $row ($table->rows) { my @values = grep {defined} @$row; print " ", join(',', @values), "\n"; } }


Well, now i want to store the output in a MySQL-DB. I currently work on the code that is needed to store the data in a MySQL-DB. I need a starting point for the creation of this db. Well see the labels and the values:

Schulnummer, 143960 Amtliche Bezeichnung,Franziskusschule Kath. Hauptschule Ahaus - Sekund +arstufe I Strasse, Hof zum Ahaus 6 Plz und Ort, 48683 Ahaus Telefon, 02561 4291990 Fax, 02561 42919920 E-Mail-Adresse, 3960@schule.nrw.de


Well, now i try to figure out the db-connection.
I look forward to some ideas - any and all ideas & hints for the starting point will be greatly appreciated.

Greetings pb1

In reply to storing some values (of an array) to a DB: how does Perl talk to MySQL? by Perlbeginner1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.