open(HOLDS,") { chomp $hold; @holds = split(/\|/,$hold,-1); $lookup = $holds[0]; open(COPIES,") { chomp $copy; @copies = split(/\|/,$copy,-1); $matchfield = $copies[0]; if($lookup eq $matchfield) { $matched = 1; print "hold and copy\n"; } } if(!$matched) { print "hold\n"; } close COPIES; } close HOLDS; open(COPIES,") { chomp $copy; @copies = split(/\|/,$copy,-1); $lookup = $copies[0]; open(HOLDS,") { chomp $hold; @holds = split(/\|/,$hold,-1); $matchfield = $holds[0]; if($lookup eq $matchfield) { $matched = 1; print "copy and hold\n"; } } if(!$matched) { print "copy\n"; } close HOLDS; } close COPIES;