$dsn = "DBI:mysql:yip;db.yip.com"; $dbh = DBI->connect($dsn,'me','pass'); $sth = $dbh->prepare("SELECT company FROM company_public;"); $sth->execute(); while($ref = $sth->fetchrow_arrayref) { push @companies, $ref->[0]; } $dbh->disconnect;