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