Почему следующая ошибка возникает для приведенного ниже кода?
DBI fetchall_hashref: invalid number of arguments: got handle + 0, expected handle + between 1 and 1 Usage: $h->fetchall_hashref($key_field)
Что я уже пробовал:
sub pending_running_partition { my $str=shift; $DBH=&connect or die "cant connect to the sql server \n"; $DBH->do("USE $str;"); my $stmt="select queue_name,jobs_pending,jobs_running from queues order by time desc;"; my $sth=$DBH->prepare($stmt); $sth->execute() or print "could not prepare_overall_queues_data"; my %TABLE_DATA=(); my @sys=qw/Adice Incisive Calibre Vcs others/; my $table = $sth->fetchall_hashref; for my $r (@$table) { my $name='others'; print $name; for my $s (@sys){ if ($r->{queue_name}=~m/$s/i) {$name=$s; last;} } $TABLE_DATA{$name}{jobs_pending}+=$r->{jobs_pending}; $TABLE_DATA{$name}{jobs_running}+=$r->{jobs_running}; } for my $var(qw/running pending/) { my @parts=(); for my $s (@sys){ push @parts,'["'.$s.'",' .$TABLE_DATA{$s}{'jobs_'.$var} .']'; } } }