If $var contains double quotes, then your code will be accessing a hash key that also contains double quotes.
If you write $my_hash{"T::c"}, then Perl sees a double-quoted string as the hash key, but the value of the double quoted string is the string without the surrounding quotes. As an alternative, you can also see that it works the same with single quotes $my_hash{'T::c'} or alternative quotes $my_hash{qq(T::c)}.
Your variable $var is equal to '"T::c"' as you already write, but in Perl source code, (double) quotes do not show up in the values they surround.
In reply to Re: hash key
by Corion
in thread hash key
by aviw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |