Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Array mysteriously growing

by duff (Parson)
on Mar 09, 2006 at 15:59 UTC ( [id://535416]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://535416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-03-29 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found