wow!

My impending question about usage of -> also got answered ...

On Thu, Aug 19, 2010 at 5:59 PM, Chas. Owens <chas.ow...@gmail.com> wrote:
> On Thu, Aug 19, 2010 at 07:51, Sharan Basappa <sharan.basa...@gmail.com> 
> wrote:
>> Hello,
>>
>> Assuming I have reference to an hash array $rHash, what would be the
>> way to dereference it.
>> Would it be: %hashEntry = %{$rHash}; ?
> snip
>
> The ways to dereference a hash are
>
> # treat $ref as a hash variable
> %$ref
>
> # treat $ref as a hash variable, useful for when the reference is not
> a simple scalar
> %{$ref}
>
> #index into $ref
> $ref->{key}
>
> # bulkier way of indexing into $ref, the -> operator is preferred
> ${$ref}{key}
>
> # take a slice of $ref
> @{$ref}{qw/k1 k2 k3/}
>
> --
> Chas. Owens
> wonkden.net
> The most important skill a programmer can have is the ability to read.
>

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to