Did you really mean @h?

Yes. And that's what I get for going back and changing the example.

when you say a "reference to an anoymous array" in any other curcumstance than saying that the [] symbols (normally) create one.

We might be agreeing about more than we are disagreeing about. I am talking about when one is created, or to use the the terminology you'll find in the docs, composed. As far as I can tell, that's exactly what we've been talking about through this whole discussion.

I dont need to account for anonymous data. Perl does it for me. :-)

The fact that perl does it for you does not entirely eliminate the need to do it yourself. Have you never found yourself needing to be sure that the last reference to some data was going out of scope? When you want the memory occupied by some piece of data to be garbage collected, you need to know that the last reference to it is going away because, otherwise, perl's accounting may work against you.

You already have a reference to it, why do you care what and or if it has a name?

I care if it is being used elsewhere in the program. Knowing where it is being used other than "here" helps me understand what is going on both "here" and "there." (Looking at this from the maintenance programmer's POV might help.) I've heard (and played a part in) the conversations many times: "Wait, so this holds a reference to the options hash?" "No, here's the assignment, it's an anonymous hash that holds a copy of the host-specific options." That sort of thing comes up all the time.

After all a lexical array is different from an anonymous dynamic array.

I'm not even sure I understand the distinction you are trying to make. In what sense are you associating the words "lexical" or "dynamic" with data? Lexical and dynamic are terms used to describe the names given to the data; i.e. the variables. Data isn't scoped, identifiers are. (In Perl, you don't even have to make the distinction between heap and stack.) Terms like "a named lexical reference" and "an anonymous dynamic array" are nonsensical.

Bah! Truth be told, id rather say "an arrayref of hashrefs" than any of the above.

The only thing that matters, of course, is that you communicate your meaning to your audience. If they understand an "arrayref of hashrefs", then use it. I just wouldn't recommend using that terminology with a general audience. ;-)

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

In reply to Re: Re: 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.