Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Iterate over a perl nested hash data structure

by NewLondonPerl1 (Acolyte)
on Feb 20, 2013 at 06:28 UTC ( [id://1019716]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1019716]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found