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