I was also told that you could add as many keys to a hash as you wanted. Is that true?
The short answer is yes.
With two caveats, though:
1. Hashes can't have duplicate keys, so that if you have twice the same key in your input, you'll end up with only one entry (probably the last one, depending on how you populate the hash exactly) in your hash.
2. The other limitation is sheer size of the data compared to the available memory on your computer. If you have tens of millions of hashes entries, you might end up at some point with an "out of memory" exception. To give a very rough idea of the limit, with one of the specific servers I am using at work, I can usually store 5 to 8 million hash entries (depending on the size of the keys and values), but usually not much more. But the limitation is only with the memory available on the platform, not with hashes or with Perl in general.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|