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

You could look in the Perl Power Tools diff implementation for some hints. A quick glance reveals Algorithm::Diff at CPAN.

"Argument is futile - you will be ignorralated!"