Q1. I have a %HOH and I would like to sort it numericaly on the internal keys how do I do? Would you please help me with this? This problem has been houting me for a couple of weeks now..

Q2. Suppose I would like I to translitterate only the first digit in a collection of strings to a letter so that if the first letter is 1 will be 'A', two will be 'B' and so on.. Is it possible to do this somehow by the tr///-function or do I have to use substitution-function?

Q3. I have a hash with keys, which consist of a numeric part and a digit part. So that the keys have names like 'A1', 'A2' 'A11', 'B3', 'C22' 'D36' ect. I would like to sort this keys so that they are first sorted by the alphabeticaly by the alpabetic part, and then in the collection of each letter, numericaly by the numerical part. I have solved this by changing all 'A' to 1, all B to 2, ..and so on.. sorting this result numericaly, and changing back the first digits back to the letters.. Is there a better way? How would you do yourself?

In reply to HOH again.. and tr/// and more.. by tamaguchi

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.