develooper Front page | perl.perl6.language | Postings from April 2001

Re: Strings vs Numbers (Re: Tying & Overloading)

From:
Bart Lateur
Date:
April 25, 2001 02:10
Subject:
Re: Strings vs Numbers (Re: Tying & Overloading)
Message ID:
8i4det8oaostigrpsjg60aqc1232rp0osl@4ax.com
On Tue, 24 Apr 2001 18:39:09 -0700 (PDT), Larry Wall wrote:

>Edward Peschko writes:
>: I guess my question is what would be the syntax to access hashes? Would
>: 
>: $hashref.{ }
>: 
>: be that desirable? I really like ->{  } in that case..
>
>It won't be either of those.  It'll simply be $hashref{ }.

Er... hip hip hurray?!?!

This is precisely the reason why I came up with the raw idea of
highlander variables in the first place: because it's annoying not being
able to access a hash passed to a sub through a hash reference, in the
normal way. Not unless you do aliasing through typeglobs. A highlander
variable would get you that: that if a hash %foo exists, the scalar $foo
would automatically be a reference to that hash.

But, if there won't be full blown highlander variables, how does Perl
know if by $foo{THERE} you mean an item of the hash %foo, or a item in a
hash referenced by the hashref $foo?

-- 
	Bart.



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