in reply to `diff`ing two files (code)

If you do go with a system call, and you don't care about what the differences are, use cmp.
system('cmp','-s',$file1,$file2) and print "Files are different!\n";