Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^7: Shouldn't references be readonly?

by jo37 (Hermit)
on Aug 05, 2020 at 18:40 UTC ( #11120340=note: print w/replies, xml ) Need Help??


in reply to Re^6: Shouldn't references be readonly?
in thread Shouldn't LITERAL references be readonly? (updated)

This a lame description of aliases. See Symbol Tables.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
  • Comment on Re^7: Shouldn't references be readonly?

Replies are listed 'Best First'.
Re^8: Shouldn't references be readonly?
by LanX (Sage) on Aug 05, 2020 at 18:53 UTC
    Nope typeglobs are only one of many possibilities to have aliases.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      This confuses me. Could you explain some of these many other ways to create aliases that end up in something different? An alias creation that does not put a reference into a symbol table entry slot?

      Greetings,
      -jo

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
        Could you explain some of these many other ways to create aliases that end up in something different?

        I named other ways in this node: @_, foreach, map, grep.

        sure see Re^6: Shouldn't references be readonly?

        DB<76> sub change { $_[0] = 666 } DB<77> $a=42 DB<78> change($a) DB<79> p $a 666 DB<80> change(42) Modification of a read-only value attempted at (eval 86)[c:/Perl_524/l +ib/perl5db.pl:737] line 2. DB<81>

        still "lame"?

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        update

        BUT!!!

        DB<81> sub change_arr { $_[0] = [666] } DB<82> $a=[42] DB<83> change_arr($a) DB<84> x $a 0 ARRAY(0x3363180) 0 666 DB<85> change_arr([42]) #NO ERROR??? DB<86>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2021-12-01 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (14 votes). Check out past polls.

    Notices?