in reply to Array/Hash References? Constructors?

The way you are using them, that is what you use to dereference the scalar $hash_ref. The curly braces are optional.

You could use:

foreach (sort keys %$hash_ref) { print; }
You use the appropriate symbol to what type of reference the scalar is holding. So...
$foo = \$bar; print $$foo; $foo = \@bar; print for @ref; $foo = \%bar; print for sort keys %$bar;
I would call them dereferencers.

Amel - f.k.a. - kel

Replies are listed 'Best First'.
Re: Re: Array/Hash References? Constructors?
by simon.proctor (Vicar) on Jul 21, 2001 at 02:34 UTC
    hehe - for clarity I would make them mandatory :). Its only a personal thing but I have found that if you do the dereferencing in the more verbose form then you are always in no doubt what you are doing. Its also much harder to miss off the odd character as well.

    Again - its only a personal preference