in reply to Looping question

$row = $st->fetchrow_hashref;
That only returns a single row. Perhaps you mean to use a loop (while my $row = $st->fetchrow_hashref ...) or perhaps you meant to use $dbh->selectall_hashref or another database method that returns multiple rows.