my $procount2 = 1; foreach my $readingframe2(@protein){ my $protein; print "string is $readingframe2\n"; my $fada; if($readingframe2 =~ /MHGR/){ print "$1\n"; ($protein)= $readingframe2 =~ /MHGR/; $fada = length($protein); print "motif is $protein\n"; if($fada >=1){ print "length of motif is $fada\n"; print OUT1 "Protein $procount2\n$protein\n"; $procount2++; } } } #### $ perl readingframe.pl Enter file name t.txt Enter output file name o.txt string is MHGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRD_MHGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRD_ Use of uninitialized value $1 in concatenation (.) or string at readingframe.pl line 68, <> line 2. motif is 1 length of motif is 1 string is CMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVTECMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVT string is AWPPPPPPPPPPPPPPPPPPPPPPPPPPPPP_LNAWPPPPPPPPPPPPPPPPPPPPPPPPPPPPP_L