In a sense the term "anonymous" is irrelevent when you are dealing with a reference to an object.

In a practical sense maybe, but I think it draws a very important distinction. Even in practice, it is at least somewhat helpful¹.

From an instructional perspective, I think it is useful to explain the difference between

my $r1 = [ { foo => 'baz', bar => 'qux' } ];
. . . and . . .
my %h = ( foo => 'baz', bar => 'qux' ); my $r2 = [ \%h ];

I think it is especially useful when you are speaking of an initialization and an anonymous composer because, at that point, you know all of the references to the anonymous data are accounted for. Even in the general case though, saying out loud, "a reference to an anonymous array containing a reference to an anonymous hash" is giving more information than saying "a reference to an anonymous array containing a reference to a hash." The latter makes me want to ask, "which hash?"

Fixed: Missing closing brace in first bit o' code. Thanks zby.

Fixed: Yes, I meant %h. Thanks demerphq.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: Re: •Re: On Declaration by sauoq
in thread On Declaration by demerphq

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.