Referencing extended to Arrays

The new variable referencing facility has been extended to arrays and even array references… I’ve tested it even on function parameters and it seems to work which is awesome… exhaustive testing has not been done ‘cos, well, nobody seems to use this site much anyway let alone code as deeply as using reference variables (check out my tiny violin), but trust me, it’s pretty impressive stuff, and highly useful.

One tiny note:
You cannot reference individual array elements, because I haven’t REALLY implemented dereferencing properly, you can only reference the whole array and index it from there, e.g.

$x=(5,4,3,2,1);
$z=\$x[0] ;
&print $z; ## expecting 5?

…wont work.
Reference the whole thing and dereference the reference as if it were an array like so:

$x=(5,4,3,2,1);
$z=\$x;
&print $$z[0];

Leave a Reply