Skip to content

Instantly share code, notes, and snippets.

@marcioferreira
Created May 16, 2016 18:00
Show Gist options
  • Save marcioferreira/f79a68ff58392b8f16856f8ce6cb7561 to your computer and use it in GitHub Desktop.
Save marcioferreira/f79a68ff58392b8f16856f8ce6cb7561 to your computer and use it in GitHub Desktop.
my %full_data = (
'email1' => uuid4('personA'),
'email2' => uuid4('personA'),
'cpf' => uuid4('personA'),
'email4' => uuid4('personB'),
'email5' => uuid4('personC'),
);
my %new_data = (
email => 'email6',
cpf => 'cpf',
);
my $_flag = 0;
for my $val (values %new_data ){
$_flag = 1 if exists $full_data{$val};
}
if ($_flag){
# match
}else{
# new
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment