Re: accessing hash values with %hash->{foo} ?
- From: "Brian McCauley" <nobull67@xxxxxxxxx>
- Date: 31 May 2006 09:50:44 -0700
Paul Lalli wrote:
I ran across this bizarreness while cleaning up someone else's old
code. A short-but-complete script to demonstrate:
Excellent!
%hash->{alpha} = 'one';
Why does this work?
It's a bug in the compiler, but becase it does no real harm and there's
bad code out there exlpoiting it, it's not been fixed. (Actually in
earlier versions of Perl it did do harm IIRC, it corrupted the ref
count).
... seems to suggest that the interpeter is allowing %hash->{foo} to
be syntactic sugar for $hash{foo}.
"Sugar" would not be the word I'd use. Bitrex perhaps?
.
- References:
- accessing hash values with %hash->{foo} ?
- From: Paul Lalli
- accessing hash values with %hash->{foo} ?
- Prev by Date: Re: BEGIN <> BEGIN
- Next by Date: Re: Negated Perl Regexp
- Previous by thread: Re: accessing hash values with %hash->{foo} ?
- Next by thread: system call problem under Win32
- Index(es):