in reply to Execute in DBI fails

You can also cut down on some code by using the DBI methods...

@row_ary = $dbh->selectrow_array($statement); $ary_ref = $dbh->selectrow_arrayref($statement); $hash_ref = $dbh->selectrow_hashref($statement);
No need for prepare and execute then.

Good luck!