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
The problematic line is
my $next_page = ($page, $config_file_tmp, $next_stage);
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With