Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Array mysteriously growing

by swkronenfeld (Hermit)
on Mar 09, 2006 at 15:17 UTC ( #535408=note: print w/replies, xml ) Need Help??


in reply to Array mysteriously growing

With your first method
my $next_version_key = $ordered_list->[($i+1)]->[0] if( $ordered_list->[($i+1)] );
The if is evaluated first, comes out to false, and the $ordered_list->[($i+1)]->[0] is never evaluated.

With your second method, the $ordered_list->[($i+1)]->[0] is evaluated first. Even if this value does not exist, it is autovivified.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2020-05-31 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?