First of all, this is not real code. Your hash assignments lack an equals sign, the closing parenthesis on
%theirs is an open parenthesis, and you're quoting the side of the hash assignment arrows that doesn't need quotes.
68.168.192.17 => 'ns1.a'
not
'68.168.192.17' => ns1.a
Your
if block is not sensible. It seems that
$_ should figure in the conditional somehow; isn't that what you want to test? Maybe something like:
if ($ours{$_} eq 'ns1.t') {
print OUT "$_\n";
}
elsif ($theirs{$_} eq 'ns1.a') {
print OUT1 "$_\n";
}
You mention a sort in your question, but not in your code. Could you give us a little clearer description of what you want your code to do?
The PerlMonk tr/// Advocate