in reply to Re^3: Traversing a hash of hashes of hashes
in thread Traversing a hash of hashes of hashes

Understood. However I face a strange issue with this: Here is an example. $bigHash is similar to my example. A hash full of other hashes full of other hashes and so forth. I don't have direct access to %bigHash only $bigHash. So, me wanting to dereference it would assume that my %newHash = %$bigHash would do the trick right? The issue is, is %newHash only contains the FIRST hash of $bigHash. I'm not entirely sure on what causes this, but I'd love to learn!
  • Comment on Re^4: Traversing a hash of hashes of hashes

Replies are listed 'Best First'.
Re^5: Traversing a hash of hashes of hashes
by Discipulus (Canon) on Mar 29, 2017 at 12:16 UTC
    Hello,

    %newHash = %$bigHash will suffice. I do not understand what you mean you do not have access to %bigHash in your example %bigHash simply does not exists: it exists an anonymous hash ie $bigHash

    For the copy what you say is impossible:

    perl -MData::Dumper -e '$href={a=>1,b=>{c=>1,d=>{e=>5}}}; %copy = %$hr +ef; print Dumper \%copy' $VAR1 = { 'a' => 1, 'b' => { 'c' => 1, 'd' => { 'e' => 5 } } };

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.