![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re: Add Hash Key Based on Matching Another Keyby jethro (Monsignor) |
on Jul 28, 2010 at 14:53 UTC ( [id://851732]=note: print w/replies, xml ) | Need Help?? |
That's what hashes are for. First create a hash with the mac address as key and the hash pointer as value (the advantage is you need to do this only once):
then your loop is reduced to this:
If you often need to know the array index too, you might store the index number as value into the hash instead of the pointer
In Section
Seekers of Perl Wisdom
|
|