perl - How do I search for a string in file with different headings? -


I use Perl to search for a specific string in a file with the sequences listed under different headings I am I present able to speak when a sequence in writing the script I have a have a title, but I am not able to to extrapolate. I'm like reqd to search for the string "FSFSD" in a given file: If the file contents can not search the following :

Polons
CACAGTGCTACGATCGATCGATDDASD
HCAYCHAYCHAYCAYCSDHADASDSADASD
Seliems
FJDSKLFJSLKFJKASFJLAKJDSADAK
DASDNJASDKJASDJDSDJHAJDASDASDASDSAD
Teerag
DFAKJASKDJASKDJADJLLKJ
SADSKADJALKDJSKJDLJKLK search

when the file is a title that is:

Terrans
FDKFJSKFJKSAFJALKFJLLJ
DKDJKASJDKSADJALKJLJKL
DJKSAFDHAKJFHAFHFJHAJJ

aS " String xyz ABC "

code I am using:

  print" Title The input file name found below \ n "; $ Protein = & lt; STDIN & gt; Chomp $ protein; Unless (open (protein, protein $)) {print "cant open file \ n \ n"; Go out; } @tpro = & lt; Protein & gt;; Closed protein; Join $ $ newprotein = ("", @pr); $ Protein = 's / s // g; What to print {print} Enter the shape \ n "; $ radix = ; Chomp $ motif; if ($ protein = ~ / artif /) {print" found article \ n \ n " } other {print "not found \ n \ n";}} while ($ motif = ~ / ^ \ s * $ /); Exit;  

  Strict use; Chet Use forests; Print "Enter the shape to be searched \ n"; My $ figure = & lt; STDIN; chomp ($ original price); $ my header; while ( 

Comments