in reply to Selecting a random number, and back calculating to chromosome and contig!

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
  • Comment on Re: Selecting a random number, and back calculating to chromosome and contig!