in reply to recursive hash layer removal question

Just out of curiosity, since I have no idea what the real data looks like, isn't there the possibility of running into a situation where you end up with duplicate keys, hence losing data? ie, if you were to have a tree like this:
my %tree = ( 'x' => { 'a' => 99, 'b' => 99, 'c' => 99, } 'y' => { 'c' => 99, 'd' => 99, 'e' => 99, } )
you'd end up losing the duplicate 'c' value. Is this a situation that might occur and needs to be anticipated somewhat?(gotta love making things more complicated :P)

Remember rule one...

Replies are listed 'Best First'.
Re^2: recursive hash layer removal question
by wertert (Sexton) on May 11, 2005 at 15:01 UTC
    Hi Forsaken real data looks like this
    $VAR1 = { 'EXCLUSTER01' => { 'IBFFTDSD72N01A' => { 'D280_3_TH' => { 'A' => { 'TH_EXCLUSTER01_03' => 999, 'TH_EXCLUSTER01_02' => 999, 'TH_EXCLUSTER01_01' => 999 } } } }, blar blar
    It represents the clusters and hosts within a storage array network ie group->hosts->disk arrays->disk controller->volumes. I'm writing a sysadm tool which allows the user to 'drill' into this recursive information. I don't think repetition within the tree is a problem
      Ok - new idea. Am I re-inventing the wheel here ? I really want to spend my time focusing on the tool i'm writing not developing and load of recursive functions for tree manipulation. Can anyone suggest a CPAN module that I should consider using ?