Dave Mitchell wrote: >Is there any reason why a my() list can't be enforced (in a strict manner) >by the lexer / grammar itself rather than post-hoc by optree inspection? If we were building this from scratch then grammatical enforcement would clearly be a good idea, with only the minor downside that we need to duplicate the productions for list syntax. Having already got into the present state, though, we can't just casually change it. It's still a good direction to go in, but we'd need a deprecation cycle, in case anyone is using syntactically strange stuff to legitimate effect. I can't imagine that there's any usage in that category that we'd actually want to preserve. A deprecation to narrow a grammatical production like this is a tricky thing to arrange. perl is not able to retry parsing of arbritrary code. I fear that we would need to duplicate a lot of the expression productions, putting deprecation warnings on all the productions other than the small group of approved items. It would be way more hassle than the qw-as-list deprecation of a few years ago. A grammatical restriction on the list content would sort out these issues with conditionals and subroutines. There might remain issues with being able to sneak stuff into single "my" items, although I wasn't able to find such a problem. If one turns up, we could do a similar deprecation to narrow the syntax of what's permitted in each "my" item. -zeframThread Previous | Thread Next