- or download this
my %h;
...
$cmp{$_} = '' for values %{$h{$id}};
print keys %cmp if scalar keys %cmp == 1;
}
- or download this
while (<>) {
my @fields = split ',';
...
for my $id (sort keys %h) {
print keys %{$h{$id}} if scalar keys %{$h{$id}} == 1;
}
- or download this
scalar keys %{$h{$_}} == 1 and print keys %{$h{$_}} for sort keys %h;
- or download this
perl -ane '$h{$F[0]}{$_}=0;END{keys%{$h{$_}}==1&&print keys%{$h{$_}}fo
+r sort keys%h}' f1.txt f2.txt