The first thing you should do is put the use strict and use warnings back and go through line by line and correct each of the many errors.

For a start, try searching for "$conig" and correct all the places where you have mis-spelt "$contig".

That said, why bother setting a variable to the value if the only thing you are going to do with that value is interpolate it into a string and print it out?

The value "2.48512e+092" looks suspicious relative to the other values around it which are all of the order e+9?

Once you ve corrected all those errors, you may get closer to your desired results, but asking for help before is unlikely to get anyone to do this work for you.

This kind of mapping problem would lend itself neatly to some kind of table lookup, which would be easily implemented in perl and would be much more compact, easier to maintain and possibly more efficient, but the starting point is a table showing what number maps to what values.

It would be possible to extract this from this behemoth of a if/elsif cascade, but you probably already have the table written down somewhere, so why shoudl we go through all that work to extract it.

If you posted a simple text table showing the required mapping, then you would probably get a reply that converst that into an nicely implemented lookup table.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

In reply to Re: Selecting a random number, and back calculating to chromosome and contig! by BrowserUk
in thread Selecting a random number, and back calculating to chromosome and contig! by Sameet

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.