open $A, 'A.txt';open $B, 'B.txt';while ($m = <$A>) { $n = <$B>; chomp $m; chomp $n; print X($m,$n), "\n";}sub X{ my ($m, $n) = @_; my $r; for (0..length($n)) { $r .= substr($m, $_, 1) eq substr($n, $_, 1)?'0':'1'; } $r;}