develooper Front page | perl.perl5.porters | Postings from March 2021

Re: undoing of auto-deref removal

Thread Previous | Thread Next
Ricardo Signes
March 3, 2021 19:30
Re: undoing of auto-deref removal
Message ID:
On Wed, Mar 3, 2021, at 5:00 AM, L A Walsh wrote:
> > In general, in Perl, if something expects to be handed a reference to 
> > an array, one can hand in a blessed object that provides 
> > array-dereference behavior.
> ----
>     "In general"?  Please state where in the documentation for perl that 
> this
> is a documented feature. 

perldoc "overload" under "Dereferencing."

>     When someone made that statement before, I asked, "How does Perl know
> an object provides array-dereference behavior.  How can perl know if it
> provides array-dereference behavior or hash-dereference behavior.  Such
> a statement is meaningless since there is nothing in the language to
> specify such a behavior.

"overload" is a well defined mechanism.  This has been present since at least 5.005.

I do not plan to engage more on this.  The matter was settled long ago and we (steering) are of one mind on the question of autoderef.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About