Richard Heintze wrote:

> Why does "@$y[$i]" work here, and "foreach $i (keys
> %$x)" works to fetch the keys from a reference to a
> hash, but I use $$x{$i} to fetch hash reference
> element values instead of %$x{$i}?
>

> This seems very inconsistent to me.
>

Maybe, but it is really not.  What you are asking for is a scalar.
Therefore having the scalar indicator at the start of the identifer
tells the interpreter to seek the reult in scalar context.  In the
case of a hash reference, this means "The scalar pointed to by the
reference $x and hash key $i". The expression
%{$x} means "The hash pointed to by hash reference $x"

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to