Oh!!! Thank you! Well, now you led me to remember an answer, while opening a question.
When you mentioned that it's not related to the fat-comma, you reminded me that hyphen itself is special, and that led me to this in perlop Symbolic Unary Operators:
Unary "-" performs arithmetic negation if the operand is numeric, including any string that looks like a number. If the operand is an identifier, a string consisting of a minus sign concatenated with the identifier is returned. Otherwise, if the string starts with a plus or minus, a string starting with the opposite sign is returned. One effect of these rules is that -bareword is equivalent to the string "-bareword". If, however, the string begins with a non-alphabetic character (excluding "+" or "-"), Perl will attempt to convert the string to a numeric and the arithmetic negation is performed. If the string cannot be cleanly converted to a numeric, Perl will give the warning Argument "the string" isn't numeric in negation (-) at ....
So that answers that: It's not fat-comma that's quoting a -key=>'value' pair, it's the hyphen.
And that leads to the question. Why is -localhost not treated like -bareword, or in other words, "-localhost"?
Dave
In reply to Re^4: How should named paramater keys be named?
by davido
in thread How should named paramater keys be named?
by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |