#!/usr/bin/perl -w # test_profile.pl use DBI; use strict; my $dbh = DBI->connect("DBI:mysql:test;host=localhost", "user", "password", {RaiseError => 1}) or die "can't connect\n"; my $query = qq{select count(*) from testdbi}; my $sth = $dbh->prepare($query); $sth->execute(); print "@$_" while $_ = $sth->fetchrow_arrayref(); $dbh->disconnect();