in reply to Re: Creating and Accessing 3-D array
in thread Creating and Accessing 3-D array

Yes, I figured out my mistake.

Autovivification is great tool. I did it that way (lazy me :-))

In my opinion, autovivification should not be taught to a beginner. It makes creating multidimentional arrays so simple that, lazy people like me will never study data structures chapter .. :-)

Thanks

Chak

---

Laziness is the mother of invention (My philosophy)

Replies are listed 'Best First'.
Re^3: Creating and Accessing 3-D array
by ikegami (Patriarch) on Feb 07, 2011 at 02:26 UTC

    The equivalent without autovivification of the snippet using autovivification is

    ( ( $sheets[$sheet] //= [] )->[$row] //= [] )->[$col] = 0;

    Your choice.