#!/usr/local/bin/perl use strict; use DBI; my $dbh = DBI->connect("DBI:mysql:host=mysql.cise.ufl.edu;dbname=mydb", "myuser", "mypass"); my $sth = $dbh->prepare("select * from foo") || die "Error in DBI::prepare: $!"; $sth->execute() || die "Error in sth::execute: $!"; while (my $row = $sth->fetchrow_arrayref) { print "@$row\n"; } $sth->finish; $dbh->disconnect;