in reply to Unquoted hash slice keys with use strict 'subs'
I wonder if it's down to the single quoting, by the compiler, of single barewords within braces i.e. a hash key context consider the following 2 equivalent statements: $hash{key} = 'some val'; & $hash{'key'} = 'some val'; - equivalent since the single quotes around the key, in the former, are inserted (if not already there) by the compiler.
As we all know, the compiler doesn't do any auto-quoting of list values (if not already quoted) - because it [the compiler] doesn't (and can't??) 2nd guess what the author intended - hence the behaviour is entirely both determinstic & consistent.
</10 penn'orth>
|
|---|