in reply to Re: using quotes in hash keys
in thread using quotes in hash keys

A "safe string" is composed of one or more alphanumeric characters, with underscore also available, but the first character has to be a letter or a dash. You could define this as a regular expression: /\-?A-Za-z_A-Za-z0-9_*/.
What about letters outside the ASCII range? Perl allows Unicode letters as variable names, for example. Do barewords here get the same treatment? $α{niņa}=5;

Replies are listed 'Best First'.
Re^3: using quotes in hash keys
by tadman (Prior) on Jul 08, 2001 at 18:30 UTC
    If anyone had the official "lex" specification for hash keys, it would be very enlightening. A "valid" string is probably a broader definition then my very conservative "safe" string specification.

    Update:
    I am implying that this would be found in the Perl source code (in a .lex file, perhaps?)
      You could look in the Perl source code. Testing whether a bareword is not a warning/error is probably not in the grammar, though, but in logic applied later.