in reply to Re: How to check that keys in two hashes match and get the corresponding values
in thread How to check that keys in two hashes match and get the corresponding values
Thanks ever so much for your help Roboticus. I have tried this out and this is now matching up these key values perfectly. I just have one question though. Maybe it because I dont fully understand all of your code but when I run this its seems to print out lines more than once. This seems to happen when either %filer_device is a hash or %filer_volume is a hash or both are hashes. So for example in the following section:
"rtsys_mpt": { "%export_name": "/bb/rtsys", "%filer_device": { "@west": "nydevnfs_rtsysgit", "@ridge": "njdevnfs_rtsysgit" }, "%filer_volume": "/vol/rtsysgit" }
When I run your code on this and just purely print out the volume and device values i get the lines duplicated like so:
njdevnfs_rtsysgit = /vol/rtsysgit nydevnfs_rtsysgit = /vol/rtsysgit njdevnfs_rtsysgit = /vol/rtsysgit nydevnfs_rtsysgit = /vol/rtsysgit
All that I need is this:
njdevnfs_rtsysgit = /vol/rtsysgit nydevnfs_rtsysgit = /vol/rtsysgit
But for some reason its duplicated? I am not too sure why? and in this section where %filer_device and %filer_volume are both hashes it outputs the same lines 3 times:
"build18_mpt": { "%export_name": "/bb/mobile", "%filer_device": { "@west": "nydevnfs_mob_build", "@ridge": "rnap2113-s" }, "%filer_volume": { "@west": "/vol/mob_build", "@ridge": "/vol/mob_build_c" } },
nydevnfs_mob_build = /vol/mob_build rnap2113-s = /vol/mob_build_c nydevnfs_mob_build = /vol/mob_build rnap2113-s = /vol/mob_build_c nydevnfs_mob_build = /vol/mob_build rnap2113-s = /vol/mob_build_c
All i need is the first two lines. The others are duplicates:
nydevnfs_mob_build = /vol/mob_build rnap2113-s = /vol/mob_build_c
Do you know why this is happening please?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to check that keys in two hashes match and get the corresponding values
by roboticus (Chancellor) on Apr 15, 2013 at 12:43 UTC |