in reply to comparing two fasta files

The zeroth step is to read perlintro, which introduces you to perl.

The first step is to look at http://search.cpan.org/, there are some modules that deal with fasta files.

The second step is to read about hashes.

Then you start hacking. Good luck. If you have problems on your way, come back here and ask.