in reply to Using the value of a scalar as a hash
As for a better approach, first thought is that those hashes should originally be constructed as hashrefs and in a hash...foreach (qw/hasha hashb hashc/) { @keys = keys eval('%' . $_); print "There are " . scalar(@keys) . " keys here for '$_'\n"; }
my %big_data = ( hasha => \%hasha, hashb => \%hashb, hashc => \%hashc, ); foreach (qw/hasha hashb hashc/) { @keys = keys %{$big_data{$_}}; print "There are " . scalar(@keys) . " keys here for '$_'\n"; }
|
|---|