for (my $i = 0; $i < @{$data}; $i++) { #### my $sth = $dbh->prepare($sql) or "Can't select from table: ",$dbh->errmsg;