I use the following snippet from http://www.perlmonks.org/?abspart=1;displaytype=displaycode;node_id=308179;part=1
for parsing fasta format files: Unfortunately, I can't find this script's author. I just modified it slightly to try your problem.
use strict; use Data::Dumper; my ($counter, $line_count, @rec); { local $/ = '>'; while (<DATA>) { s/^>//g; # strip out '>' from beginning s/>$//g; # and end of line next if !length($_); # ignore empty lines my ($header_info) = /^(.*)\n/; # capture the header s/^(.*)\n//; # and strip it out push @rec, $header_info; s/\n//mg; # join the sequence strings $counter++ if $_=~/ACGACACGTAT/; } } $line_count = scalar @rec; print "$line_count seqeuences were tested and $counter seqeuences hav +e a tag\n"; __DATA__ >GJVIMO101AUT0H length=45 xy=0234_0223 region=1 run=R_2010_07_01_11_09 +_50_ ACGACACGTATACGTGCGTGTCGCGTCTCTCAGCACACAGAGTAG >GJVIMO101ANKZK length=45 xy=0151_1902 region=1 run=R_2010_07_01_11_09 +_50_ ACGACACGTATCGCGCGCGNGCGCGCGCGCGCGCGCGCGCGCGCG >GJVIMO101AOIE9 length=41 xy=0162_0179 region=1 run=R_2010_07_01_11_09 +_50_ ACGACACGTATCTCATTGTGCTCAAGGCCTGAGCACAATGA >GJVIMO101ALCLG length=100 xy=0126_0114 region=1 run=R_2010_07_01_11_0 +9_50_ ACGACACGTATGCTGCTGGTGCTGCTGTAACAGTTCCTGCTGATGCTGCAAGTGCTGCTG CTGTAACTGTTGCTGCTGTAATCTCTGCTGCTGCTGCTGT >GJVIMO111ALCLG length=100 xy=0126_0114 region=1 run=R_2010_07_01_11_0 +9_50_ GCTGCTGGTGCTGCTGTAACAGTTCCTGCTGATGCTGCAAGTGCTGCTG CTGTAACTGTTGCTGCTGTAATCTCTGCTGCTGCTGCTGT

In reply to Re: Regex Match Problem by umasuresh
in thread Regex Match Problem by twaddlac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.