|Don't ask to ask, just ask|
Looping through arrays : are they equal ?by ZlR (Chaplain)
|on Apr 21, 2011 at 18:47 UTC||Need Help??|
ZlR has asked for the
wisdom of the Perl Monks concerning the following question:
Hello Perl Pros,
Here i am once again with a desperate attempt to sort my way through weird system configs with Perl.
At this point i have a hash where the values are a list of references to arrays. It's not really interesting what's inside, but maybe that structure is not the best one for my problem, or maybe you're just curious, so : the keys are unique adresses and each list is a bunch of devices mapped to it. I need to make sure that every device is in every list, that is that all these list are equals.
It should be easy, but i find myself doing this in an ugly way.
Here's what my hash looks like :
It could be that there is only one key, or more than 2. Also, in the end, i'm looping through a structure to build this hash, but let's forget that.
Here's what i do :
Anyone has a nicer way ? Thanks !