# example my $dbh = DBI->connect( ... ); #... my @row = doSelect($dbh, 'foobar'); #... sub doSelect{ my ($dbh, $table) = @_; my $sth = $dbh->prepare("SELECT * FROM $table LIMIT 1"); $sth->execute(); return $sth->fetchrow_array(); }