http://qs321.pair.com?node_id=1230015


in reply to Re: prevent stringification for hash-keys
in thread prevent stringification for hash-keys

Heheh yes tobyink I thought about that too, but the OP appears to want to forbid in code the use of a string as a hash key, whether quoted or not, and only allow using a declared variable. IIUC.


The way forward always starts with a minimal test.
  • Comment on Re^2: prevent stringification for hash-keys

Replies are listed 'Best First'.
Re^3: prevent stringification for hash-keys
by soonix (Canon) on Feb 17, 2019 at 07:27 UTC
    No, he wants to avoid stringification of hash keys, especially of barewords.

      "What I really want is a way to make $hash{bare_word} a compile-time error in a lexical scope..."


      The way forward always starts with a minimal test.
        Terminology is a bitch. While it's true that interpreting a bareword as string, which occurs at complile time, is not called stringification, I think it is clear that OP wants $hash{blahblah} treated differently from $hash{'blahblah'} … only the former should be a syntax terror, something like use stricter; .-)