in reply to Hashes: long or short?
Using aliases to deep points in your data structure can be a good way to shorten your code. I find that when working "deep", I try and use a pointer as a starting point that is as close as is practical to the final values.my %db; tie(%db, 'NDBM_File', ...); my $userdata = \%{$db{userdata}}; my $config = \%{$db{config}}; if ($userdata->{foo} && $config->{key}) { # ... }
|
|---|