Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^6: Thx, St. Larry, for the Beauty of Sigils

by shmem (Chancellor)
on Jul 27, 2019 at 14:35 UTC ( #11103507=note: print w/replies, xml ) Need Help??


in reply to Re^5: Thx, St. Larry, for the Beauty of Sigils
in thread Thx, St. Larry, for the Beauty of Sigils

No, since you already got the meaning.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re^6: Thx, St. Larry, for the Beauty of Sigils

Replies are listed 'Best First'.
Re^7: Thx, St. Larry, for the Beauty of Sigils
by LanX (Archbishop) on Jul 27, 2019 at 14:36 UTC
    blah

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

      blah

      sigh... "plain variables" are "named variables".

      $var = "Hello world!"; # \ @ary = qw(foo bar baz); # - plain %hash = qw(foo 1 bar 2 baz 3); # / $sref = \$var; # \ $aref = \@ary; # - references $href = \%hash; # /

      References which aren't references of plain (or named) variables are anonymous.

      E.g. we speak of $ary = [] as of an anonymous array which happens to be stored in the plain (or named) scalar variable $ary, be that stored in a symbol table or a pad.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11103507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2020-06-04 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?