in reply to processeing records in a file

Can't you use one of the existing CPAN modules to handle the FASTA stuff? (BioPerlTutorial seems like a good starter.) Selecting certain sequences and reverse complementing them sounds like standard functionality i.e. a method call.