3 ms·
Yeah, I pretty sure Perl also called them associative arrays, but like you I haven’t written much Perl since Perl 4/5.
by meling 4y ago
Yeah, I pretty sure Perl also called them associative arrays, but like you I haven’t written much Perl since Perl 4/5.
- darrenf 4y agoIn all my time as a Perl dev (since 1996) I don't think I've ever heard the term "associative array" except at the start of `perldoc perldata` - which says they're known as hashes and then never uses the term again. DESCRIPTION Variable names Perl has three built-in data types: scalars, arrays of scalars, and associative arrays of scalars, known as "hashes". A scalar is a single string (of any size, limited only by the available memory), number, or a reference to something (which will be discussed in perlref). Normal arrays are ordered lists of scalars indexed by number, starting with 0. Hashes are unordered collections of scalar values indexed by their associated string key. Hash is ubiquitous.
- draegtun 4y agoYes they used to be called Associative Arrays. I think the change occurred between Perl4 & Perl5. In Programming Perl it says "Associative Arrays" in 1st edition and "Hashes (Associative Arrays)" in 2nd edition. NB. 2nd edition was the first to cover Perl5