Skip Menu |

This queue is for tickets about the enum CPAN distribution.

Report information
The Basics
Id: 95387
Status: resolved
Priority: 0/
Queue: enum

People
Owner: NEILB [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.07
Fixed in: 1.08



Subject: Not inlined anymore since perl 5.19.3
perl 5.19.3 has this change documented: * Closures of the form "sub () { $some_variable }" are no longer inlined, causing changes to the variable to be ignored by callers of the subroutine. [perl #79908] Indeed, it seems that constants created by enum() are not anymore inlined in bleedperl: $ perl5.18.2 -MO=Deparse -e 'use strict; use enum qw(:BLA_ A B C); warn BLA_A; warn BLA_B' use enum (':BLA_', 'A', 'B', 'C'); use strict; warn 0; warn 1; -e syntax OK $ perl5.19.11 -MO=Deparse -e 'use strict; use enum qw(:BLA_ A B C); warn BLA_A; warn BLA_B' use enum (':BLA_', 'A', 'B', 'C'); use strict; warn BLA_A; warn BLA_B; -e syntax OK The change is discussed in https://rt.perl.org/Public/Bug/Display.html?id=119047 and https://rt.perl.org/Public/Bug/Display.html?id=79908 . It seems that the problem can be fixed using a string eval, e.g. using the change as proposed in https://rt.cpan.org/Ticket/Display.html?id=49827 Regards, Slaven
Thanks for the report and links, Slaven. Working on the change now, will release it tomorrow morning. Cheers, Neil
New release is making its way round CPAN. % /usr/local/src/perl-5.19.11/perl -I/usr/local/src/perl-5.19.11/lib -MO=Deparse \ -e 'use strict; use enum qw(:BLA_ A B C); warn BLA_A; warn BLA_B' use enum (':BLA_', 'A', 'B', 'C'); use strict; warn 0; warn 1; -e syntax OK
Fixed in 1.08