Find duplicate value comparing 2 files and create an output

I need a perl script which will create an output file after comparing two diff file in a directory path:
/export/home/abc/file1
/export/home/abc/file2

File Format: <IP>TAB<DeviceName><TAB>DESCRIPTIONS

file1:
10.1.2.1.3<tab>abc123def<tab>xyz.mm1.ppp.
#10.1.2.1.4<tab>abc345def<tab>xyz.mm2.ppp2.
10.1.2.1.5<tab>abc567def<tab>xyz.mm4.ppp3.
10.1.2.1.6<tab>abc789def<tab>xyz.mm5.ppp6.
#10.1.2.1.7<tab>abc009def<tab>xyz.mm9.ppp7

file2:

10.1.2.1.3<tab>abc123def<tab>xyz.mm1.ppp.
#10.1.2.1.4<tab>abc345def<tab>xyz.mm2.ppp2.
10.1.2.1.5<tab>abc009def<tab>xyz.mm7.ppp9
10.1.2.1.6<tab>abc567def<tab>xyz.mm4.ppp3.
#10.1.2.1.9<tab>abc009def<tab>xyz.mm9.ppp7

If IP and Device name both are match on both file1 and file2 then Out put file would say �duplicate IP and device found�. If just duplicate IP and or device found the output file will indicate �duplicate IP found� or �duplicate device found�

I don't care 3rd column; the script will look for match in 1st and/or 2nd column and must not ignore IP which has "#" in front of it.

OUTPUT:

Duplicate IP and device found:

10.1.2.1.3<tab>abc123def
#10.1.2.1.4<tab>abc345def

Duplicate IP Found:

10.1.2.1.6
10.1.2.1.5

Duplicate Device found
abc009def

Thank you very much. btw, this is not a home work.

try awk:

awk ' FILENAME=="file1" { arr[$1 $2]=$1 " " $2; arrip[$1]=$1; arrdev[$2]=$2
      }
      FILENAME=="file2" {
         if($1 ~ /^#/) {$1=substr($1,2)}
      	 if(arr[$1 $2]> " ") { print "Duplicate ip and device found", arr[$1 $2]
      	                  continue}
      	 if(arrip[$1]>" ") {print "Duplicate ip found",arrip[$1]
      	                continue}
      	 if(arrdev[$2]>" ") {print "Duplicate device found", arrdev[$2]}
      }
      ' file1 file2

Output based on your files:

Thanks, but I am facing complicated situation.
There are multiple files:

  1. filenane.xxx
  2. finename.abcnnxyz

So the scripts needs to compare filenane.xxx files with finename.abcnnxyz files.

In other works, compare all files filenane.xxx with finename.abcnnxyz look for duplciates. There are 15/20 diff filenane.xxx type of files and may be 10/15 finename.abcnnxyz of files.

Thanks.