develooper Front page | perl.perl5.porters | Postings from November 2022

OP_ANONCODE and diagnostic messages

Thread Next
Felipe Gasper
November 10, 2022 14:14
OP_ANONCODE and diagnostic messages
Message ID:
Hi all,

	Sometime back I merged a change to make `sub {}` parse to OP_ANONCODE rather than OP_SREFGEN/OP_ANONCODE. There’s been some CPAN breakage from this change, documented here:

	Paul graciously fixed some of the breakage. I have a PR pending that I think addresses the rest:

	That PR, however, will still leave at least 2 CPAN modules broken because, as a side-effect of my original change, OP_DESC for a coderef will now be “anonymous subroutine” rather than “single ref constructor”. For example:

> perl5.34 -w -e 'sub {}'
Useless use of single ref constructor in void context at -e line 1.

> bleadperl -w -e 'sub {}'
Useless use of anonymous subroutine in void context at -e line 1.

	In my opinion the latter is an improvement; however, those CPAN modules--I think there are 2--that expect the former in their tests would need updates.

	Is this an acceptable behaviour change?


p.s. That PR could use another round of review, if someone has the chance. Thank you!

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About