I don't see any obvious problems with your grammar. Indeed, it is very simple, no recursion and little ambiguity. Sometimes P::RD is slower than one would like. But parsing (tens of) gigabytes is a big job in any case. If P::RD is too slow, you might try to roll your own parser:
while (<DATA>) { if (/^<160> NUMBER OF SEQ ID NOS: (\d+)$/) { $seq_num = $1; } elsif (/^<140> CURRENT APPLICATION NUMBER: ([\w\/,]+)$/) { $appl_num = $1; } elsif (/^<210> SEQ ID NO (\d+)$/) { $cur_seq = $1; $seq{$cur_seq} = {}; } elsif (/^<211> LENGTH: (\d+)$/) { $seq{$cur_seq}{length} = $1; } elsif (/^<212> TYPE: (DNA|PRT)$/) { $seq{$cur_seq}{type} = $1; } elsif (/^<213> ORGANISM: (\w+ \w+)$/) { $seq{$cur_seq}{organism} = $1; } elsif (/^<220> FEATURE:([\w\s]*)$/) { $seq{$cur_seq}{feature} = $1; } elsif (/^<221> NAME\/KEY: (\w+)$/) { $seq{$cur_seq}{name_key} = $1; } elsif (/^<222> LOCATION: ([\d\.\(\)]+)$/) { $seq{$cur_seq}{location} = $1; } elsif (/^<223> OTHER INFORMATION: ([^<]+)$/) { $seq{$cur_seq}{other} = $1; } elsif (/^<400> SEQUENCE: (\d+)$/) { $seq{$cur_seq}{seq_num} = $1; } elsif (/^([\w\s]+)$/) { $seq{$cur_seq}{seq} .= $1; } else { die "Unrecognized line: $_\n"; } } foreach my $cur_seq (keys %seq) { print "Sequence: $cur_seq, Organism: $seq{$cur_seq}{organism}\n"; print "seq: $seq{$cur_seq}{seq}\n\n"; } __DATA__ <160> NUMBER OF SEQ ID NOS: 727 <140> CURRENT APPLICATION NUMBER: US/09/984,429 <210> SEQ ID NO 1 <211> LENGTH: 733 <212> TYPE: DNA <213> ORGANISM: Homo sapiens <400> SEQUENCE: 1 gggatccgga gcccaaatct tctgacaaaa ctcacacatg cccaccgtgc ccagcacct +g 60 aattcgaggg tgcaccgtca gtcttcctct tccccccaaa acccaaggac accctcatg +a 120 tctcccggac tcctgaggtc acatgcgtgg tggtggacgt aagccacgaa gaccctgag +g 180 tcaagttcaa ctggtacgtg gacggcgtgg aggtgcataa tgccaagaca aagccgcgg +g 240 aggagcagta caacagcacg taccgtgtgg tcagcgtcct caccgtcctg caccaggac +t 300 ggctgaatgg caaggagtac aagtgcaagg tctccaacaa agccctccca acccccatc +g 360 agaaaaccat ctccaaagcc aaagggcagc cccgagaacc acaggtgtac accctgccc +c 420 catcccggga tgagctgacc aagaaccagg tcagcctgac ctgcctggtc aaaggcttc +t 480 atccaagcga catcgccgtg gagtgggaga gcaatgggca gccggagaac aactacaag +a 540 ccacgcctcc cgtgctggac tccgacggct ccttcttcct ctacagcaag ctcaccgtg +g 600 acaagagcag gtggcagcag gggaacgtct tctcatgctc cgtgatgcat gaggctctg +c 660 acaaccacta cacgcagaag agcctctccc tgtctccggg taaatgagtg cgacggccg +c 720 gactctagag gat + 733 <210> SEQ ID NO 2 <211> LENGTH: 5 <212> TYPE: PRT <213> ORGANISM: Homo sapiens <220> FEATURE: <221> NAME/KEY: Site <222> LOCATION: (3) <223> OTHER INFORMATION: Xaa equals any of the twenty naturally ocurri +ng L-amino acids <400> SEQUENCE: 2 Trp Ser Xaa Trp Ser 1 5

-Mark


In reply to Re: Parse::RecDescent help by kvale
in thread Parse::RecDescent help by glwtta

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.