On Tue, 2003-01-28 at 16:23, Leopold Toetsch wrote:
> Austin Hastings wrote:
> 
> 
> > Another question: If you ask for a value and get it, does the array
> > grow? Or does that happen only on assignment? (
> 
> 
> Arrays (or hashes) don't grow on reading - never.

Never say never. You're correct for pure reading like so:

        $x = @a[0];

But for less pure forms of reading:

        foo(@a[0]);

auto-vivification will have to happen in some cases. e.g. if foo
requires a lvalue parameter. You can't know if an actual write will
happen, so you have to auto-vivify in order to pass a reference.

Or did I miss something there?

-- 
Aaron Sherman <[EMAIL PROTECTED]>
This message (c) 2003 by Aaron Sherman,
and granted to the Public Domain in 2023.
Fight the DMCA and copyright extension!


Reply via email to