On Sun Sep 14 22:53:04 2014, sprout wrote: > While this would take care of map {{ .... }} and map {no ...}. But > what about map{BEGIN...}? The current behaviour is to treat BEGIN as > not-a-keyword unless it is at the beginning of a statement (more > precisely, unless PL_expect is XSTATE). Is it acceptable to break > that? > > $ ./perl -Ilib -le 'print for map {BEGIN . $_} 3..5' > BEGIN3 > BEGIN4 > BEGIN5 Nothing on CPAN matches /(printf?|say|map|grep)\s*\{\s*(BEGIN|AUTOLOAD|UNITCHECK|DESTROY|END|INIT|CHECK)\b/, nor can I think of any real use for this, so I think it is acceptable. > Also, setting PL_expect to XSTATE will allow pod where we did not > allow it before: > > map { > =cut > blah blah blah > =cut > {...} } > > but it would be very hard to see through the pod to detect the opening > brace (based on the current pod implementation, though I am wondering > whether changing the implementation to make this work would actually > simplify it). And presumably that example should behave the same way > as this: > > map { > # a multiline > # comment that actually > # consists of multiple > # single-line comments > {...} } > > Or at least one might expect it to. Or maybe not, since pod is only allowed at the beginning of a statement, so it currently is not treated as just whitespace. -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=122782Thread Previous