You confusion is between '-' being part of the bareword, and - as the unary negation operator. perl -MO=Deparse,-p -e "$foo{-bar}" outputs $foo{-'bar'};. The scalar negation operator is defined rather oddly in perl -- when you try to negate a string, it doesn't nummify and then negate (which would give 0), but rather prepends a dash.
There is still some bareword magic going on, to turn the b (in your example) into 'b' rather then a call to the (non-existant) b() function.
In reply to Re: bareword hash keys
by theorbtwo
in thread bareword hash keys
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |