jeudi 18 juin 2015

Print all non-matching items in Perl

I have a perl script that compares text from two files. The files on most days should be exactly the same, but if for some reason some of the text in the file changes I want the script to print out all the text that is not exactly the same as in the other folder. I want it to print out the differences between the files.

if($atext !~m/$btext/){
print $1;
}

That is what I currently have but it is giving me the error, "Use of uninitialized value $1 in print at blah blah blah".

Aucun commentaire:

Enregistrer un commentaire