http://qs321.pair.com?node_id=542665


in reply to traversing a hash looking for path?

I was somewhat excited to see a module that did something neat when the two previous posters mentioned Graph but after looking at it and the extensive documentation and no tutorials I thought this was too much...

The method I was thinking of is a hash of a hash; the key of the hash is all the IP's and the values are a hash with with your linked IP's.

my %network = ( '1.2.3.4' => {'1.2.3.5' => undef, '1.2.3.6' => undef, '1.2.3.7' => undef }, '1.2.3.5' => {'1.2.3.4' => undef, '1.2.3.6' => undef, '1.2.3.7' => undef }, '1.2.3.6' => {'1.2.3.4' => undef, '1.2.3.5' => undef, '1.2.3.7' => undef }, '1.2.3.7' => {'1.2.3.4' => undef, '1.2.3.5' => undef, '1.2.3.6' => undef }, );

Replies are listed 'Best First'.
Re^2: traversing a hash looking for path?
by Anonymous Monk on Apr 11, 2006 at 21:05 UTC
    I've been looking at the documentation and I agree. I can easily create a hash of hashes with my info, and then I suppose I hand it off to graph and look for has_edge providing my start and end node?