my $statement= q{ SELECT COUNT(*) FROM products WHERE nr = ? }; my $count = $dbh->selectrow_array($statement, {}, $nr);