Okay, here you see the elements of the array (@array) for one textblock (after using split). Now it should be easier to understand the rest of the script.

[0] NC_014171.1 [1] RefSeq [2] gene [3] 14311 [4] 14425 [5] . [6] + [7] . [8] ID=NC_014171.1:rrs_1;locus_tag=BMB171_C5091;db_xref=GeneID:9190898 new line but same 'textblock' of data [0] NC_014171.1 [1] RefSeq [2] exon (oder CDS) [3] 14311 [4] 14425 [5] . [6] + [7] . [8] ID=NC_014171.1:rrs_1:unknown_transcript_1;Parent=NC_014171.1:rrs_1 +;gbkey=rRNA;locus_tag=BMB171_C5091;product=5S ribosomal RNA;db_xref=G +eneID:9190898;exon_number=1

What I want is to create a hash: I want to extract the number behind the word 'GeneID' (line one of textblock, at the end of element 8) and this number should be the key of my hash. The values for my hash should first be stored in an array. I need the following information as values for my array: line one of textblock: $array 3 which is a number, $array 4 again a number, $ array 6 which is + or - line two of textblock $array 2 which can be the word 'CDS' or 'exon' So far the script is working. Problems arise when the next text block is processed.


In reply to Re^2: problems with flip flop by bio25
in thread problems with flip flop by bio25

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.