如何解决“在 void 上下文中无用地使用变量”的情况?
如何解决“在空上下文中无用使用变量”的情况? (第 17 行)
sub next {
my $page = shift;
my $next_stage = $page->{tree}->{nextstage};
my $prev_stage = $page->{stage};
print "Moving from: $prev_stage to $next_stage.\n" if ($DEBUG);
if ($next_stage eq "end") {
serialize_grabber_conf_answers($page, $config_file_tmp);
$grabber_initialized = 1;
return FALSE;
}
unless (defined ($page->{next_page})) {
serialize_grabber_conf_answers($page, $config_file_tmp);
my $next_page = ($page, $config_file_tmp, $next_stage);
$next_page->{stage} = $next_stage;
$page->{next_page} = $next_page;
$next_page->{prev_page} = $page;
}
return FALSE;
}
谢谢
How can I resolve this case of 'Useless use of a variable in a void context'? (line 17)
sub next {
my $page = shift;
my $next_stage = $page->{tree}->{nextstage};
my $prev_stage = $page->{stage};
print "Moving from: $prev_stage to $next_stage.\n" if ($DEBUG);
if ($next_stage eq "end") {
serialize_grabber_conf_answers($page, $config_file_tmp);
$grabber_initialized = 1;
return FALSE;
}
unless (defined ($page->{next_page})) {
serialize_grabber_conf_answers($page, $config_file_tmp);
my $next_page = ($page, $config_file_tmp, $next_stage);
$next_page->{stage} = $next_stage;
$page->{next_page} = $next_page;
$next_page->{prev_page} = $page;
}
return FALSE;
}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有问题的行是
您正在分配给标量,因此仅使用列表的最后一个成员。以前的成员被丢弃——变量的无用使用。
The problematic line is
You are assigning to a scalar, so only the last member of the list will be used. The previous members are thrown away - useless use of a variable.