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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |