Note: If you're unsure what a reference is, better check perlreftut and perlref. This node is not about Perl syntax or internals; it is about the English-ish jargon used to discuss references and related concepts.

Given:

use Devel::Peek; use Perl6::Form; my $dog; my $cat; my $bob; my $sue; { my $pest = 'flea'; $dog = \$pest; $cat = \$pest; $bob = \$dog; $sue = \$cat; } ### say q{}; say 'Dump $dog:'; Dump $dog; say q{}; say 'Dump $cat:'; Dump $cat; say q{}; say 'Dump $bob:'; Dump $bob; say q{}; say 'Dump $sue:'; Dump $sue; say q{}; ### say q{}; say q*| $ $$ $$$ + |*; say q*|-------------------------------------------------------------- +-----|*; print form qq*|dog {<<<<<<<<<<<<<<<} {<<<<<<<<<<<<<<<} + |*, $dog, $$dog, qq*|cat {<<<<<<<<<<<<<<<} {<<<<<<<<<<<<<<<} + |*, $cat, $$cat, qq*|bob {<<<<<<<<<<<<<<<} {<<<<<<<<<<<<<<<} {<<<<<<<<< +<<<} |*, $bob, $$bob, $$$bob, qq*|sue {<<<<<<<<<<<<<<<} {<<<<<<<<<<<<<<<} {<<<<<<<<< +<<<} |*, $sue, $$sue, $$$sue, ; ## end form say q*|-------------------------------------------------------------- +-----|*; say q{}; ### my $t = 'A'; print qq*|$t| *; $t++; say q* $dog eq $cat: *, $dog eq $cat; print qq*|$t| *; $t++; say q* $$dog eq $$cat: *, $$dog eq $$cat; print qq*|$t| *; $t++; say q* $bob eq $sue: *, $bob eq $sue; print qq*|$t| *; $t++; say q* $$bob eq $$sue: *, $$bob eq $$sue; print qq*|$t| *; $t++; say q* $$$bob eq $$$sue: *, $$$bob eq $$$sue; #say $pest; say q{}; __END__ Output: Dump $dog: SV = RV(0xa080f4c) at 0xa080f40 REFCNT = 2 FLAGS = (PADMY,ROK) RV = 0xa216eb8 SV = PV(0x9fbb6d8) at 0xa216eb8 REFCNT = 2 FLAGS = (PADMY,POK,pPOK) PV = 0xa21cff0 "flea"\0 CUR = 4 LEN = 8 Dump $cat: SV = RV(0xa08148c) at 0xa081480 REFCNT = 2 FLAGS = (PADMY,ROK) RV = 0xa216eb8 SV = PV(0x9fbb6d8) at 0xa216eb8 REFCNT = 2 FLAGS = (PADMY,POK,pPOK) PV = 0xa21cff0 "flea"\0 CUR = 4 LEN = 8 Dump $bob: SV = RV(0x9fdd9a4) at 0x9fdd998 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0xa080f40 SV = RV(0xa080f4c) at 0xa080f40 REFCNT = 2 FLAGS = (PADMY,ROK) RV = 0xa216eb8 SV = PV(0x9fbb6d8) at 0xa216eb8 REFCNT = 2 FLAGS = (PADMY,POK,pPOK) PV = 0xa21cff0 "flea"\0 CUR = 4 LEN = 8 Dump $sue: SV = RV(0x9fdd8f4) at 0x9fdd8e8 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0xa081480 SV = RV(0xa08148c) at 0xa081480 REFCNT = 2 FLAGS = (PADMY,ROK) RV = 0xa216eb8 SV = PV(0x9fbb6d8) at 0xa216eb8 REFCNT = 2 FLAGS = (PADMY,POK,pPOK) PV = 0xa21cff0 "flea"\0 CUR = 4 LEN = 8 | $ $$ $$$ | |-------------------------------------------------------------------| |dog SCALAR(0xa216eb8) flea | |cat SCALAR(0xa216eb8) flea | |bob REF(0xa080f40) SCALAR(0xa216eb8) flea | |sue REF(0xa081480) SCALAR(0xa216eb8) flea | |-------------------------------------------------------------------| |A| $dog eq $cat: 1 |B| $$dog eq $$cat: 1 |C| $bob eq $sue: |D| $$bob eq $$sue: 1 |E| $$$bob eq $$$sue: 1

Uncommenting the line say $pest; raises a compile-time strict exception, of course; that package $pest is not my $pest. I do this only to make clear that I'm not concerned about this in the least. I don't care what is or is not in scope; only what to call stuff when speaking English to you (for some value of 'English').

This is a fill-in-the-blanks question. Please choose words you want to use to talk about the things in the blanks.

Please be kind enough to number your picks according to the numbered blanks. It's okay to use the same word to fill in more than one blank if you consider the relationships expressed equivalent. You don't need to fill in all of the blanks for your reply to be useful. Thank you.

Summary:

  1. holds,
    has the value,
    contains,
    has,
    is,
  2. points to [something] that points to,
    is a reference to a reference to,
  3. reference to a reference,
    pointer to a reference,
    pointer to a pointer,
    indirect reference,
  4. points to a reference to a reference to,
    is a reference to a reference to a reference to,
    refers to a reference to [a reference to],
  5. RV,
    address,
    referent,
  6. referent of the referent,
    indirect referent,
  7. value of the referent,
  8. value of the referent of the referent,
  9. equal,
    both references to [something],
  10. both references to references to [something],
    [both] indirect references to [something],

In reply to What's Really in a Reference? by Xiong

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.