in reply to Re: How to validate %hash = ( 'a' => 'b', ...);
in thread How to validate %hash = ( 'a' => 'b', ...);
... I expected omitting the redundant quotes to produce "bareword" errors under strict ... but funnily the auto-quoting effect of the fat comma => has higher precedence than the concat operator. (?)
Um ... operator effect precedence? As different from operator precedence? I don't like that phrasing :D
http://perldoc.perl.org/perlop.html#Comma-Operator says
The special quoting behavior ignores precedence, and hence may apply to part of the left operand:That example prints something like "1314363215shiftbbb" , because the => implicitly quotes the shift immediately on its left, ignoring the fact that time.shift is the entire left operand.print time.shift => "bbb";
At least this phrasing doesn't bring up precedence, but still seems forced
First part is much better
The => operator (sometimes pronounced "fat comma") is a synonym for the comma except thatit causes a word on its left to be interpreted as a string if it begins with a letter or underscore and is composed only of letters, digits and underscores.
shift is the word on the left, thats the rule, no matter the "entire left operand" , big fat comma quotes the word on the left, the end :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to validate %hash = ( 'a' => 'b', ...);
by LanX (Saint) on Sep 12, 2016 at 10:08 UTC |