use strict; open(DNA, 'reaction_mapformula.lst'); while(my $protein = ) { if(my $protien =~ m/^R\d\d\d\d\d$/){ print "it"; }else{ print "no"; } }