Compare 2 arrays consisting of hashes

From: Frodo Larik (no_no_mail_at_e-l33t.com)
Date: 05/30/04


Date: Sun, 30 May 2004 16:43:31 +0200

Hello,

Say I have two arrays, like this

my @master = ( { href => 'http://server1', text => 'This is Server 1'},
                { href => 'http://server2', text => 'This is Server 2'} );

my @slave = ( { href => 'http://server1', text => 'This is Server 1'},
               { href => 'http://server3', text => 'This is Server 3'} );

And I want to check for every instance in @slave if the data is in
@master, if not add data to @master.

The arrays can become very big, so I'm looking for a way to efficiently
do this. So without a lot of for or foreach loops.

Is it possible?

Sincerely,

Frodo Larik