in reply to HASH Array advice
Is it wise to use intergers for keys in a hash array?
Wise? It's certainly okay, but it's not inherently better than using strings for the hash keys. In fact, the integers will be implicitely converted to strings anyway (i.e., 1 becomes '1' and 2 becomes '2'). This does not create any problems, though, because it's transparent and fully reversible (unlike, say, using references as hash keys, which creates problems in Perl5, although I think Perl6 is fixing that).
So, feel free to use the numbers as your hash keys if it suits your purposes, but in a different situation if strings would suit your purposes better, then use those. TMTOWTDI.
|
|---|