perl中的文件比较

perl中的文件比较,perl,Perl,我是perl新手 我有两个文本文件: 文件1包含两行: mahesh bharti mahesh orange 文件2包含两行: mahesh bharti mahesh orange 正如您所看到的,这两个文件之间的区别是bharti和orange。不知何故,我能够打印出差异。但我的要求是它应该打印如下 Difference of file as below: File1 contain: bharti FIle2 contain: orange 我当前用perl编写的代码如下所示,

我是perl新手

我有两个文本文件:

文件1包含两行:

mahesh
bharti
mahesh
orange
文件2包含两行:

mahesh
bharti
mahesh
orange
正如您所看到的,这两个文件之间的区别是
bharti
orange
。不知何故,我能够打印出差异。但我的要求是它应该打印如下

Difference of file as below:
File1 contain: bharti
FIle2 contain: orange

我当前用perl编写的代码如下所示,请使用该模块。

我可以理解为什么该代码不适用于您。:)