in reply to called too early to check prototype

My guess is that you're using the sub before you declare its prototype.

Try putting:

sub check_gene($); sub check_gene_seq($); sub extractseq($);

at the top. Or you could just move the sub's above your main code.