in reply to linking to mysql database
The way to do this is to use the DBI module in Perl. Take a look at the tutorial, "Reading from a database," here in the monastery.