The standard way of handling relational databases in Perl is through the DBI module. DBI acts as the portal into which you pass SQL queries, and out of which you pull the results. DBI then handles the details of interfacing with a database driver, and gives you a fairly simple interface to your database. I recommend reading the DBI documentation thoroughly, paying particular attention to the examples given. Keep an eye open for the portion of the POD that discusses placeholders; they're important. Also, when you think of error handling, think along the same lines as what you already practice with flat files. That is, always check return values to ensure that operations have succeeded.
And then there's SQL. There are as many different flavors of SQL as there are databases, but they all have a lot in common. You can begin to learn the common, basic portion of SQL by visiting this site: http://www.w3schools.com/sql/default.asp. It's a decent online tutorial geared at providing newcomers to SQL with enough of the basics that they can get some work done, while still leaving plenty of room for growth.
Read the DBI documentation, and the SQL tutorial two times, and the light bulb should flick on.
Minor nit to pick. You mentioned converting a PHP website to CGI. CGI isn't Perl. CGI is the "Common Gateway Interface". CGI server-side programs can be written in C, Perl, PHP, and a plethora of other languages. I assume what you mean is converting a PHP based site to a Perl based one.
Dave
In reply to Re: SQL- for starters
by davido
in thread SQL- for starters
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |