$dbh->selectcol_arrayref($statement); instead of $sth->selectcol_arrayref($statement);