I recently figured that there is a selectrow_array function to fetch values from databases. I'm getting following error when I'm using it. I wonder what is the issue here and couldn't find an alternative way to do this.
Code is:
my $db_connection = DBI->connect($dsn, $dbuser, $dbpassword ) or die $DBI::errstr;
my $sql_statement = "SELECT customer_id,quota FROM customer_call_quota WHERE quota>=1";
while (my $row = $db_connection->selectrow_array($sql_statement)) {
my ($cust_id, $quota) = @$row; #<---- error line
}
my $rc = $db_connection->disconnect ;
return "ok";
Error:
Can't use string ("value") as an ARRAY ref while "strict refs" in use at code.pl line ...