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
$y = $z;
$z = $x->[2];
$x->[2] = $x->[3];
....
$x->[$#$x - 1] = $x->[$#$x];
pop @$x;
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!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.