Data Structure help (hash/array)



Hi,

I am comparing two different datasets and trying to come up with the best data structure.

Data Set 1:

For each record, I get a pair like this:

$VAR1 = {
'TARGET' => '110974981305651',
'INTERNAL_ID' => '1000000000000005'
};
$VAR2 = {
'TARGET' => '111053548637000',
'INTERNAL_ID' => '111053624881107'
};
$VAR3 = {
'TARGET' => '111040401095000',
'INTERNAL_ID' => '111040426288012'
};

Data set 2:

For another record, I get a similar pair:

$VAR1 = {
'Instanceid' => 58538,
'Interfaceid' => 52
};
$VAR2 = {
'Instanceid' => 407401,
'Interfaceid' => 55
};
$VAR3 = {
'Instanceid' => 58536,
'Interfaceid' => 69
};
$VAR4 = {
'Instanceid' => 263954,
'Interfaceid' => 692
};

My goal is to connect this above two dataset based on another dataset (link table) that looks like this:

$VAR1 = {
'Interfaceid' => '52',
'TARGET' => '111053548637000'
};
$VAR2 = {
'Interfaceid' => '55',
'TARGET' => '110974981305651'
};
$VAR3 = {
'Interfaceid' => '69',
'TARGET' => '111040401095000'
}

The final output is to connect the internal id with the instanceid. How should I approach it? I was thinking each dataset could of array of hash.

--sharif
.