good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^5: RFC: Is there more to alias?by fergal (Chaplain) |
on Aug 24, 2004 at 23:46 UTC ( [id://385546]=note: print w/replies, xml ) | Need Help?? |
Does the first 1 autovivify the arrayref in $x (as $x->[0] = 1 would) or must $x already have an array ref in it? What happens if I do shift @$x? Is $x->[0] now an alias to $z and the alias to $y disappears? Or (unlikely) does it effectively do @{$x} = @{$x}[1..($#$x-1)] which amounts to
Fun and games! The second example one seems very odd to me. To me, it reads as alias(push(@x, $y)) but I guess perl doesn't parse it as that. Why do this rather than just alias $x[-1] = $y or should that be alias $y = $x[-1]? So you can use , or = to separate the aliased things? And you can put alias on either side of the =? Anyway, time for bed. I dreamt about object pascal last night, I hope I don't dream about aliases to night!
In Section
Meditations
|
|