in reply to Re: More effective way to increase two elements of a list in parallel?
in thread More effective way to increase two elements of a list in parallel?

Note that
if (my $node = shift @nodes) { $map{$node} = $pdu . '['.$pdu_num.']'; }

is not the same as the OP's code. Your code won't process the if if the first element of @nodes is false. Better to use

if (@nodes) { my $node = shift @nodes; $map{$node} = $pdu . '['.$pdu_num.']'; }


Unless I state otherwise, all my code runs with strict and warnings