I didn't think to have a block scoped switching of syntax, don't think this would be wise.
That's block scoped the same way other pragmas are block scoped, if you want to use them on a whole file that's just fine, but if you want to be able to have a finer control over when the aliasing happens, (because you think the aliasing looks like you break the encapsulation on objects, or one of the two variables has magic that the other bypasses (once again, by magic I mostly mean ties) and you'd rather have a compile time than a run time bug) you should be able to.

or @a should be an alias of @$a and always reflect the list form of wherever $a points.
That's not possible, because this means that \@a would not have a constant value for the duration of the program. And you can't magic your way out of it because sometimes only the stringified ref is kept (as the key of a hash).

As for your declaration proposition, I'll say that offering a better safety net is always a good idea. I've been bitten before because I absentmindedly used the wrong brackets for my type, like $var->{3} when really I was thinking about an array the whole time, but for some reason I confused the two, or my finger just went on typing the brackets they were told to use the X previous time in a row. So ++ for compile time types :).


In reply to Re^5: Unifying namespaces of @name and $name to simplify dereferencing? (declaration of typed references) by Eily
in thread Unifying namespaces of @name and $name to simplify dereferencing? by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.