in reply to Array mysteriously growing

This also doesn't answer your question, but rather than checking if there's a "next element" in your array, check that your index hasn't gone beyond the end of your array:

$next_version_key = $ordered_list->[$i+1]->[0] if $i+1 < @{$ordered_li +st};

Replies are listed 'Best First'.
Re^2: Array mysteriously growing
by pKai (Priest) on Mar 09, 2006 at 22:21 UTC

    Depending what appears more natural to you, you can also check this as

    if $i < $#$ordered_list;

      Aye. I prefer the way I did it because it uses $i+1 in both places.