http://qs1969.pair.com?node_id=344353


in reply to Re: Making little array babies
in thread Making little array babies

I personally like davido's solution the best, if you can live with the undef items at the end. However I would change the push, in the case where the baby arrays are small to :

push @lol, [ shift(@images), shift(@images), shift(@images) ];

It's just more explicit. The guy that comes after you won't have to think about what is going on here, it's obvious.

Of course if the actual baby arrays are large, or thier length changes programatically, stick with his original code.

Replies are listed 'Best First'.
Re: Re: Re: Making little array babies
by vaya11 (Initiate) on Apr 14, 2004 at 00:49 UTC
    Thank you all for the help,

    It was a good introduction to understanding how to store arrays in an array. I ended up using a combination of davido and nmcfarl's code which worked quite nicely and was understandable to look at quickly.

    Also, as I was halfway through reading the responses, I noticed someone named Randal L. Schwartz had replied, then a few minutes later I happen to glance down at the author of the book open in front of me... quite an honor.

    Lyndon.