http://www.perlmonks.org?node_id=950801


in reply to Re: Printing keys from a hash by value?
in thread Printing keys from a hash by value?

That is very interesting. I can surely use this to benchmark the different algorithms.

However, could you enlighten me on how the first part works? perldoc has nothing on chr... Thanks!

  • Comment on Re^2: Printing keys from a hash by value?

Replies are listed 'Best First'.
Re^3: Printing keys from a hash by value?
by aaron_baugher (Curate) on Jan 30, 2012 at 20:53 UTC

    chr gives the character corresponding to an ASCII value. 65 = 'A', 66 = 'B', and so on. In retrospect, I could have made my loop 65..90, but I think 1..26 makes it more obvious that I'm spanning the alphabet. Putting x4 after it just turns 'A' into 'AAAA' and so on, to make it more obvious that they're words.

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

Re^3: Printing keys from a hash by value?
by Anonymous Monk on Jan 30, 2012 at 19:49 UTC