in reply to Clarifying the Comma Operator

Actually, I didn't suggest identifier should replace word. I said any that looks like an identifier. Note that perldata in its second paragraph already defines how identifiers look like.

but I worry that identifier might have limitations that would not be appropriate.
Don't. Think about it. When parsing, on encountering a possible 'bare word', the parser doesn't look ahead and say "hmmm, let me see, if the token following this bare word thingy isn't a fat comma, I'm going to parse it as an identifier, because it's got to be a subroutine or a file/dir handle, but if it isn't followed by a fat comma, I'm going to accept something slightly different". No, the parser is going to parse something that may be a valid identifier. Then it looks whether it's in autoquoting context (next token is a fat comma, or we're indexing in a hash and the next token is a close brace), in which case the thing just parsed is a string, otherwise, it is indeed an identifier (subroutine, file/dir handle).

Replies are listed 'Best First'.
Re^2: Clarifying the Comma Operator
by ig (Vicar) on Jun 07, 2009 at 01:41 UTC

    My apologies for expressing my idea as yours, and I didn't even fully appreciate your earlier comment. With your clarification, rethinking and rereading perldata, I think I get it.

    I am now inclined to replace word with word that looks like an identifier. I think this is very consistent with what perl actually does and provides a reasonably clear and concise description.

    As for the bit in parentheses: it would then be redundant with the definition of identifier in perldata. So the question is: what's worse: a redundant statement or making users jump between documents?