Perl スクリプトの次の部分があります。
my $thread_count = 20
my %QUEUES;
my $current_queue=0;
while(defined($INPUT[$cnt]))
{
while (my @instance = $q1->fetchrow_array)
{
my $walk = "string";
push @{$QUEUES{$current_queue}},$walk;
$current_queue=($current_queue+1)%$thread_count;
}
while (my @instance = $q2->fetchrow_array) {
my $walk = "string";
push @{$QUEUES{$current_queue}},$walk;
$current_queue=($current_queue+1)%$thread_count;
}
}
コマンドを配列にプッシュしようとしていましたが、これをハッシュに保持することにしました。if(!defined($QUEUES[$current_queue]))$QUEUES[$current_queue]=[];
通常の for ループを使用Data::Dumper
したところ、0 から $thread_count-1 までの $QUEUE のどのキーにも何も定義されていないことがわかりました。これは教科書的な自動蘇生の使い方ではないでしょうか?私は何を間違っていますか?