laziness, impatience, and hubris | |
PerlMonks |
Re^4: Unique key identifer?by roboticus (Chancellor) |
on Jun 28, 2014 at 00:21 UTC ( [id://1091529]=note: print w/replies, xml ) | Need Help?? |
Yes, the task was too simple to really need much in the way of a data structure. I contemplated using a single hash with a string or bitmap for +/-, and also an HoA where different array slots would handle different symbols (+, -). In the end, I went with a HoH because it should be easy to understand, and didn't need any gymnastics. Two hashes works fine, too, it just didn't occur to me. ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|