As per subject: what are the characters that can be used in hash keys or, if it’s shorter, which ones can’t be used?
Also, are there any problems in using long hash keys (like full path names)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See How Hashes Really Work for a discussion on this topic. In short, as long as you quote the key (non-interpolating q{}), you can use whatever characters you want.
Regarding Dana’s answer, no, it won’t take longer for longer keys to get matched: it will take infinitesimally longer to hash the key, but that’s all.
For reference, this is the hashing function in Perl 5.10.0: