hotshot has asked for the wisdom of the Perl Monks concerning the following question:
hello dear monks!
I have two hashes in the following format:
the first hash is old configuration, and the second hash will be new configuration. I need to restart the protocol(s) that one or more of their IP addresses were changed (including an index change), therefore I need some kind of diff function that will return me the changed protocols, for example afp and I'll know to restart it.
Anyone with an idea?
Hotshot
I have two hashes in the following format:
As you can see, the key is an IP address and the value is a file protocol name and an index.my %hash = ( '1.1.1.1' => 'nfs,1', '4.4.4.4' => 'cifs,0', '10.0.4.2' => 'afp,1', '3.3.3.3' => 'nfs,0', '5.5.5.5' => 'afp,0', );
the first hash is old configuration, and the second hash will be new configuration. I need to restart the protocol(s) that one or more of their IP addresses were changed (including an index change), therefore I need some kind of diff function that will return me the changed protocols, for example afp and I'll know to restart it.
Anyone with an idea?
Hotshot
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Diff on hashes
by djantzen (Priest) on Nov 12, 2002 at 13:55 UTC | |
Re: Diff on hashes
by robartes (Priest) on Nov 12, 2002 at 14:31 UTC | |
Re: Diff on hashes
by Wonko the sane (Deacon) on Nov 12, 2002 at 14:22 UTC | |
by hotshot (Prior) on Nov 13, 2002 at 15:23 UTC | |
Re: Diff on hashes
by reyjrar (Hermit) on Nov 12, 2002 at 14:24 UTC | |
Re: Diff on hashes
by rinceWind (Monsignor) on Nov 13, 2002 at 11:33 UTC |
Back to
Seekers of Perl Wisdom