develooper Front page | perl.perl5.porters | Postings from December 2018

Re: [perl #133712] Confusingly, perlref calls a hash in the examples%array

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
December 6, 2018 09:57
Subject:
Re: [perl #133712] Confusingly, perlref calls a hash in the examples%array
Message ID:
20181206095719.GA3037@iabyn.com
On Wed, Dec 05, 2018 at 07:07:27PM -0800, James E Keenan via RT wrote:
> On Wed, 05 Dec 2018 23:04:52 GMT, choroba@matfyz.cz wrote:
> > The subject says it all. $array{ aaa }{ bbb }{ ccc } is confusing,
> > since it's a hash, not an array.

> The code examples you are proposing to change were written by Larry Wall
> in commit 748a93069b3 in March 1995.  We haven't changed them in all
> that time ... which makes me suspect we have a reason for doing so
> (though I myself don't know what that reason is).

I should imagine it's because until perl 5, hashes were called associative
arrays, and therefore using 'array' as the name for one of them was
reasonable at the time. I see no reason not to apply this patch.

-- 
The warp engines start playing up a bit, but seem to sort themselves out
after a while without any intervention from boy genius Wesley Crusher.
    -- Things That Never Happen in "Star Trek" #17

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About