in reply to Add Hash Key Based on Matching Another Key

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):

my %macs; foreach @aps { $macs{$_->{'ap_MAC'}}=$_; }

then your loop is reduced to this:

$macs{"00:00:00:00:00:00"}{'serial'} = "FTX12345678";

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

Replies are listed 'Best First'.
Re^2: Add Hash Key Based on Matching Another Key
by spickles (Scribe) on Jul 28, 2010 at 15:51 UTC
    Thanks everyone! Just what I needed.