Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 15, 2006 at 02:12:34AM -0400, Jonathan Vanasco wrote:
> On Jul 13, 2006, at 7:41 PM, Philip M. Gollucci wrote:

> I thought read once that within an array declaration, [] is a real =20
> array and not a reference-- or did i dream that up and have been =20
> dealing with anonymous arrays all along?

Well, both :-)

> ie:
> my @real=3D ( 1 , [11,12,13] , 2 ,[21,22,23] );
> my $ref=3D [1,2,3];
> i could have sworn i read that when @real is compiled, the array-in-=20
> an-array is real array and not a ref

The construct [1,2,3] allocates a real array somewhere in Perl's belly
and returns a ref to it, much like the construct
char *str=3D"abracadabra";

allocates a character array in C, but puts a pointer to it in the
variable *str.

So [1, 2, [3, 4, 5], 6]

just makes an array of 4 entries (of which the third, that's the one
with index 2, is a reference to a freshly allocated array of three
entries) and yields a raference to this whole thing.

So well, real arrays are involved somewhere, and you (or your code) get
a handle to those.

> i'm hopped up on too much codeine right now (bronchitis), so i'm =20
> thinking less clearly than normal. forgive what's probably a stupid =20
> question.

But you got it right, somehow ;-)

I hope your bronchitis gets better
-- tom=C3=A1s

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

Version: GnuPG v1.4.1 (GNU/Linux)