The unquoted strings (a.k.a. "bareword strings") are ambiguous. If, for some strange reason, the Perl interpreter decides to interpret name as a function or somesuch, there could be logic bugs. So, some consider it good practice merely to quote all bareword strings (hash keys included) simply to promote readability and "take no risks".
The fact of the matter is, though, that the likelihood of a bareword being confusing to the interpreter and not generating a warning or error -- even in future Perl releases -- is fantastically small. So, don't worry about it!
In any case, just pick one and be consistent. If you think quoted strings are better in place of barewords, go ahead and use them -- just use them in every case. Consistency makes for far more readable (and maintainable) code than adherance to anyone else's ideas of "right code".
In reply to Re: Correct keys in hashes
by radiantmatrix
in thread Correct keys in hashes
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |