作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用一组线程处理数据并将其与另一个线程一起入队,目前入队和出队过程似乎无法正常工作
有什么想法吗??
sub process() {
while (my @DataElement = $DataQueue->dequeue()) {
print "\t".$DataElement[0]."\n";
}
}
我使用下面的方法来排队数据
my @l;
push(@l, $directories.$suffix);
push(@l, "testclass");
push(@l, $eachFile);
$DataQueue->enqueue(\@l);
最佳答案
您是否在不取消引用的情况下访问数组引用?尝试
while (my $DataElementRef = $DataQueue->dequeue()) {
my @DataElement = @$DataElementRef;
print "\t".$DataElement[0]."\n";
}
关于perl - 使用 thread::queue 在 perl 中对数组进行出队,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2541345/
我的 JavaScript 代码中有一道数学题。我需要将给定数量的玩家随机分成 2 队,这样每次 - 如果玩家想再次比赛 - 团队都会重新组成,并且在形成所有组合之前他们应该不同。 假设我有 4 个玩
我是一名优秀的程序员,十分优秀!