Databases in Perl

This week we will look at how to use databases in perl. Some of you have database experience in your background, but others don't. I have provided an introduction to databases and SQL below.

Databases are also particularly useful when processing form data. While we have used forms in the midterm already, some of you have forgotten some of your form HTML, so I've also included information on creating forms and the different input types below.

We will not be doing any advanced database programming in class (though, if you're interested in that, Web Enabled Databases would be a great class to take). Thus, I am not going into significant detail about the SQL. However, since some of you will want to use databases for your final projects, it's good to know these basics as they will support many applications.

Please review the background material below and then check out the short lecture and sample code on DBI. To run this you need access to a server with a database. You don't have that by default. If you need it, I can probably get you space. You also might consider getting a domain name for yourself. I use Start Logic for my personal sites; it's very cheap ($4/month), provides perl and database access, and I've had no problems with them.

Web Forms Lecture

Database Lecture

DBI Lecture

To use Databases in perl, you use the DBI module. Here are details on how to use that module including a video lecture and sample code.

Readings

Links