--ZGiS0Q5IWpPtfppv
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:
>=20
> 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 :-)

>=20
> ie:
>=20
> my @real=3D ( 1 , [11,12,13] , 2 ,[21,22,23] );
> my $ref=3D [1,2,3];
>=20
> 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
=20
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

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEvPgDBcgs9XrR2kYRAjsxAJ9LkrNEejtSEePcGm/bgWCvcyMsIwCdGxIg
G4E/9FcrLowPA7wyzz2oJ6Q=
=Z/yV
-----END PGP SIGNATURE-----

--ZGiS0Q5IWpPtfppv--