note
QM
Yes. The reason I don't like string literals as hash keys, is it's too easy in some contexts to create data on one hash key, look for it with another key, and decide that nothing interesting happened. I'd much prefer the interpreter tell me "no such variable" -- I'd rather have the explicit message, rather than a quiet failure.
<p>
And missing out the <code>+</code> to avoid string interpolation of the bareword is something I'm likely to do.
<p>
In production code, I try never to have string literals, except where they are assigned to variables or constants. And since, in Perl, constants are a bit funny, I use scalars as being less likely to be accidentally overwritten.
<p>
I liked the idea of restricted keys, such as in [doc://Hash::Util], though I can still mistype string literals when accessing hashes, so "constant" scalars are still valuable to me.
<div class="pmsig"><div class="pmsig-294463">
<p>-QM<br />
--<br />
Quantum Mechanics: The dreams stuff is made of
</div></div>
11128524
11128552