my $dbh = DBI->connect("DBI:mysql:fenonn:localhost","fenonn","password"); my $sth = $dbh->prepare("SELECT data1 FROM table1"); $sth->execute() || die "Couldn't execute statement: DBI::errstr; stopped"; my ( $data ) = $sth->fetchrow_array(); $dbh->disconnect; print $data;