# This?
if( exists $hash{ sprintf "%#x", ord('a') } ) { ... }
# or this?
if( exists $hash{a} ) { ... }
I'd say that we don't know enough about his needs to make the determination that he ought to be storing stringified hexadecimal values as hash keys. There may be specific cases where that's useful, but in the general case it smells bad to me.
It almost seems like he's trying to create a hash that crossreferences hex values with literal characters. That's working too hard, when chr, ord, and sprintf already have the conversions down pat.
|