use strict; use warnings; use File::Compare; my %exclude; my $file1 = $ARGV[0] || die 'No file 1'; my $file2 = $ARGV[1] || die 'No file 2'; my $txtdatei = $ARGV[3] || 'No file 3'; my $compare = compare($file2, $file1); open my $file, '<', $file1 or die $!; while (<$file>) { chomp; $exclude{$_}++; } open my $txtfh, '>', $txtdatei or die $!; open $file, '<', $file2 or die $!; while (<$file>) { chomp; if($compare == 1){ #print $txtfh "False! the files are not equal \n"; print $txtfh "FALSE! $_\n" unless $exclude{$_}; } elsif($compare == 0){ print $txtfh "True! the Files are equal \n"; } } close $txtfh;