in reply to Array mysteriously growing
With your first method
With your second method, the $ordered_list->[($i+1)]->[0] is evaluated first. Even if this value does not exist, it is autovivified.
The if is evaluated first, comes out to false, and the $ordered_list->[($i+1)]->[0] is never evaluated.my $next_version_key = $ordered_list->[($i+1)]->[0] if( $ordered_list->[($i+1)] );
With your second method, the $ordered_list->[($i+1)]->[0] is evaluated first. Even if this value does not exist, it is autovivified.
|
---|
In Section
Seekers of Perl Wisdom