[aklug] Re: Lists

From: Michael Fowler <michael@shoebox.net>
Date: Tue Jul 26 2011 - 14:12:46 AKDT

On Tue, Jul 26, 2011 at 02:04:20PM -0800, Michael Fowler wrote:
> perl -MDevel::Peek -wle '@x = qw( a b ); Dump(\@x);'
> ...
> SV = PVAV(0x919f6f0) at 0x91b93b8
> REFCNT = 2
> FLAGS = ()
> ARRAY = 0x91bce38
> FILL = 1
> MAX = 3
> ARYLEN = 0x0
> FLAGS = (REAL)
> Elt No. 0
> SV = PV(0x919c6d8) at 0x919e818
> ...
> Elt No. 1
> SV = PV(0x919c768) at 0x919e9d8
> ...
>
> MAX being the length of the array.

Woops, MAX is the maximum allocated elements. FILL is used for the
length; it's the maximum index, used for both the length (off by one)
and last index ($#array).

--
Michael Fowler
www.shoebox.net
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Jul 26 14:13:15 2011

This archive was generated by hypermail 2.1.8 : Tue Jul 26 2011 - 14:13:15 AKDT