Well yes that's how it's implemented in Perl - and other languages like Python or JS too - but doesn't help comparing languages.

They all store references into their "namespaces" or "lexical pads"

Perl for instance does a *array= [1,2,3] to create a package variable accessible as @array °

Python and JS do essentially* the same thing!!!

Only the syntax to access and operate those variables is different.

the following is legal² JS code ³

>> $a = [1,2,3] Array(3) [ 1, 2, 3 ] >> $a[0] // Perl: $a->[0] 1 >> $b = $a Array(3) [ 1, 2, 3 ] >> $b[0]=666 // Perl $b->[0] = 666 666 >> $a Array(3) [ 666, 2, 3 ]

and "anonymous" only refers to the literal [array] or {hash} constructors not to the scalar on the LHS of an assignment.

The difference is not "named" or "unnamed", but explicit or implicit dereferencing.

If anything, references are the "plain" fundamental thing..

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

°) or scalars, but this can't be easily written *scalar = \1 is not the same thing

*) JS has primitive values (read scalar) and objects (read blessed references), there is no explicit referencing only implicit.

²) JS has no sigils $ is a legal part of an identifier to allow "machine translations", jQuery is messing with that.

³) updated and extended


In reply to Re^9: Thx, St. Larry, for the Beauty of Sigils by LanX
in thread Thx, St. Larry, for the Beauty of Sigils by msouth

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.