I would actually prefere the first way, since each level of indirection
in the second call adds an overhead on performance, nothing major, but
in a simple case like this, i dont' see any reason why it shouldn't be
eliminated.
----- Original Message -----
From: [EMAIL PROTECTED] (Timothy Kimball)
Date: Monday, June 4, 2001 4:00 pm
Subject: RE: Records put into a hash - Beginner Question
>
> Joel Stout wrote:
> : Many thanks, one last tidbit:
> : Is it better to :
> :
> : %Fields = %{$Accts{$account}};
> : foreach $name ( keys %Fields ) {
> :
> : print "$name : $Fields{$name}\n";
> : }
> :
> : or
> :
> : foreach $name ( keys %{$Accts{$account}} ) {
> :
> : print "$name : <ok I'm stuck again>\n";
> :
> : }
>
> I'd say it depends on whether you want to use %Fields
> as a has so much that dereferencing it from %Accts is a pain.
> My preference would be the second way:
>
> foreach $name ( keys %{$Accts{$account}} ) {
>
> print "$name : $Accts{$account}{$name}\n";
>
> }
>
> -- tdk
>