上は省略
up = File.open(output,"w")

while aline = file.gets
aline.chomp!
names, afirst, asecond, = aline.split(/\t/).values_at(0,1,2)
# afirstもasecondも数字が入る
moji = ""

while bline = file2.gets
bline.chomp!
bfirst, bsecond, = bline.split(/\t/)[0..1]
# bfirstもbsecondも数字が入る
if afirst = bfirst && asecond = bsecond
moji = "○"
break
end
end
up.print "#{names}\t#{afirst}\t#{asecond}\t#{moji}\n"
end

up.close


このようにしてプログラムを実行したところ
全ての行にmojiとして○がついています。
if文で一致する行だけ○をつけたつもりなのですが、どこがおかしいのでしょうか?
p afirst や p bsecond で確認したところ、ちゃんとsplitで分割されていました。