in reply to prevent stringification for hash-keys

Perl::Critic::Policy::CodeLayout::ProhibitHashBarewords

  • Comment on Re: prevent stringification for hash-keys

Replies are listed 'Best First'.
Re^2: prevent stringification for hash-keys
by 1nickt (Canon) on Feb 17, 2019 at 03:22 UTC

    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.
      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.