in reply to DBI fetch array

From perldoc DBI (highlighting by me):

$hash_ref = $sth->fetchrow_hashref; An alternative to `fetchrow_arrayref'. Fetches the **next row** of data and returns it as a reference to a hash containing field name and field value pairs. Null fields are returned as `undef' values in the hash.
To fetch all rows, use $dbh->selectall_arrayref.

Or in your case, where there is only one column:

my @rows = @{$dbh->selectcol_arrayref($sql)};