%perl> # get data requested and return my ($statement, $sth, $ref); $statement = 'SELECT cid, currency FROM currency ORDER BY currency;'; $sth = $dbh->prepare($statement) or die "Couldn't prepare statement: $dbh->errstr"; $sth->execute or die "Couldn't execute statement: $dbh->errstr"; while ($ref = $sth->fetchrow_hashref){ # store one or more rows of data in a structure } return $data_structure