XP is just a number | |
PerlMonks |
Re^2: How to validate %hash = ( 'a' => 'b', ...);by Anonymous Monk |
on Sep 12, 2016 at 07:29 UTC ( [id://1171563]=note: print w/replies, xml ) | Need Help?? |
... 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. 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 :)
In Section
Seekers of Perl Wisdom
|
|