on linear code like that it may make things hader to read, but I don't see what's wrong with

my %hash = ( ..... ); foreach my $key1 (@keyset1) { my $inner = $hash{$key1}; foreach my $key2 (@keyset2) { print $inner->{$key2}; } }

instead of

my %hash = ( ..... ); foreach my $key1 (@keyset1) { foreach my $key2 (@keyset2) { print $hash{$key1}{$key2}; } }

That doesn't sacrifice too much in readability, I think


In reply to Re: Re: The Cost of Nested Referencing by lestrrat
in thread The Cost of Nested Referencing by shotgunefx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":