Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
According to Advanced Perl Programming, I see that hash keys always employ the string representation.
I have a hash with integer keys -- lots of (sparse) integer keys. I am running into a memory limitation. Could I save memory by storing the MIME::Base64 version of the integer key? (Or perhaps using pack to create a 4-byte or 8-byte string.)
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: are perl hash keys always strings?
by Fletch (Bishop) on Dec 22, 2010 at 16:56 UTC | |
|
Re: are perl hash keys always strings?
by ikegami (Patriarch) on Dec 22, 2010 at 16:55 UTC | |
|
Re: are perl hash keys always strings?
by BrowserUk (Patriarch) on Dec 22, 2010 at 17:44 UTC | |
|
Re: are perl hash keys always strings?
by JavaFan (Canon) on Dec 22, 2010 at 17:21 UTC |