in reply to storing some values (of an array) to a DB: how does Perl talk to MySQL?
Books I recommend:
- Learning SQL by Alan Beaulieu
This book starts from ground zero and uses MySQL for the examples using the mySQL command tool.
Your project can be done without getting really fancy - read at least up to about page 75. And do the examples as you go! There are some minor mistakes and you will see those as you go along. But this is a great book.
- Programming the Perl DBI by Alligator Descartes & Tim Bunce.
This is more general book. Chapter 5, "Interactng with the Database" has some relevant stuff for you.
Right now you should focus on the first book that I recommended above.
Before you ask how to make Perl do some SQL thing, you need to understand clearly how you would do that SQL operation yourself from the command line tool!
Once you understand "Learning SQL", then I think the tutorials will help a lot and you will find that translating a simple SQL statement into the right syntax for the DBI will be a lot, a whole lot easier for you.
Since you started on the project some months ago, I have seen that you often try to take too big of a step at one time. Like going from "playing with bottle rockets in the backyard" to "let's fly to the moon"!
Along with that goes trying to program some really, really complex thing in a completely automatic fashion that you can do easily in a few minutes with a little manual guidance. The last code that I sent you was a good example of that principle.
You will need to draw some diagrams and think a whole lot about your tables structure. These should be created manually from the command line tool (at the MySQL> prompt).
Your Perl code is going to come down to populating those already existing tables with data. Again before writing program code, you should be able to insert a data record manually from the command line tool.
So your "homework" is to read at least first part of "Learning SQL". Then make a baby step, by writing some Perl code that does a record insertion like you will already know how to do from the command line tool. Then, do the same thing with some "real data". Pursue your database learning as an independent thing from the web page scraping. Get each major piece working by itself before trying to integrate the whole thing together.
Oh, another point, inevitably you are going to have a "real DBI" question. When you do, take out all of say the HTML parsing stuff and boil it down to a direct question with as few dependencies as possible. If you have an HTML parsing question, make a direct question about just that part.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: storing some values (of an array) to a DB: how does Perl talk to MySQL?
by Perlbeginner1 (Scribe) on Dec 20, 2010 at 23:49 UTC | |
by Marshall (Canon) on Dec 21, 2010 at 01:54 UTC |