in reply to Re^2: Iterate over a perl nested hash data structure
in thread Iterate over a perl nested hash data structure

Sorry I am trying to paste in what data::dumper prints out to show you what this hash of hashes looks like but when I use the code tags / its just not displaying correctly

Replies are listed 'Best First'.
Re^4: Iterate over a perl nested hash data structure
by tmharish (Friar) on Feb 20, 2013 at 07:29 UTC

    From this:

    $VAR2 = { 'dev' => [ { 'nfsmount' => { 'bigstor_nfs' => { 'bigstor17_mpt' => { 'filer_device' => { 'ny_loc' => 'nnap5307-s', 'nj_loc' => 'nydevnfs_bigstor_volC' }, 'filer_volume' => { 'ny_loc' => '/vol/bigstor_volC/bigstor +17', 'nj_loc' => '/vol/bigstor_volC/bigstor +17' }, ... More here ...

    To access 'nydevnfs_bigstor_volC' you would do:

    $VAR2->{dev}[0]{nfsmoun}{bigstor_nfs}{bigstor17_mpt}{filer_device}{nj_ +loc}

    You can use the iteration logic provided below along with this to reach any element you need.

    HTH

Re^4: Iterate over a perl nested hash data structure
by ww (Archbishop) on Feb 20, 2013 at 12:43 UTC
    That's because you omitted the closing code tag, </code>. Pls fix.