Tnx Jim! I was looking at u script but still is not what I need:

>
>
>

> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my @G1 = (["alfa" ,  "10"], ["beta" ,  "11"]);
> my @L1 = (["alfa" ,   "10"], ["gamma" ,  "12"]);
> my @G2 =('gamma');
>
> # populate a hash with the elements of G1
> my %unique;
> for my $e1 ( @G1 ) {
>  $unique{$e1->[0]} = $e1->[1];
> }
>
> # add elements in L1 not in G1
> # delete elements in both
> my %overlap;
> for my $e2 ( @L1 ) {
>  my( $key, $val ) = @$e2;
>  if( exists $unique{$key} ) {
>    $overlap{$key} = 1;
>    delete $unique{$key};
>  }else{
>    $unique{$key} = $val;
>  }
> }
>
> print "Overlap: ", join(', ',keys %overlap),"\n";
> print "Unique: ", join(', ',keys %unique),"\n";
>
> # eliminate unique elements also in G2
> for my $e3 ( @G2 ) {
>  delete $unique{$e3};
> }
>
> print "Remains: ", join(", ", keys %unique), "\n";


The results of u script are:

Overlap: alfa
Unique: gamma, beta
Remains: beta

 What I need is really different:

Overlap have to be: alfa,10 (couse the couple is already in @G1 and @L1);
Unique have to be: beta,11 (couse the other couple of value in array
(gamma,12 and gamma) have to be excluded both couse gamma exist in both!
I don't really know how to explaine better, Im just tryng to do what usually
do with a single oracle query and that now i cant do couse i don't have
grants for a dblink..

Tnx again all for the patient with a noob like me :)

Vito

Reply via email to