Compare 2 arrays consisting of hashes
From: Frodo Larik (no_no_mail_at_e-l33t.com)
Date: 05/30/04
- Next message: Joel Smith: "control other applications using perl"
- Previous message: Darick: "how to make the page expired when click back button"
- Next in thread: Jürgen Exner: "Re: Compare 2 arrays consisting of hashes"
- Reply: Jürgen Exner: "Re: Compare 2 arrays consisting of hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Joel Smith: "control other applications using perl"
- Previous message: Darick: "how to make the page expired when click back button"
- Next in thread: Jürgen Exner: "Re: Compare 2 arrays consisting of hashes"
- Reply: Jürgen Exner: "Re: Compare 2 arrays consisting of hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]