CC: | reneeb via RT <perlbug-followup [...] perl.org>, Perl5 Porteros <perl5-porters [...] perl.org>, bug-Marpa-R2 [...] rt.cpan.org |
Subject: | Re: [perl #119047] Bleadperl v5.19.2-138-g137da2b breaks JKEGL/Marpa-R2-2.064000.tar.gz |
Date: | Tue, 30 Jul 2013 10:53:04 +0200 |
To: | Leon Timmermans <fawaka [...] gmail.com> |
From: | demerphq <demerphq [...] gmail.com> |
On 29 July 2013 19:47, Leon Timmermans <fawaka@gmail.com> wrote:
Show quoted text
> On Mon, Jul 29, 2013 at 7:26 PM, demerphq <demerphq@gmail.com> wrote:
Ah yes, it should be:
*$bar= eval "sub () { $foo }";
So that the $foo is frozen.
Yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
>> Does this mean one cannot use
>>
>> sub foo () { 1 }
>>
>> to create a constant anymore?
>>
>> If so, IMO this breaks a lot of code.
>
> If I understand this correctly, the problem is that this doesn't do
> exactly what it used to do:
>
> my $foo = 1;
> for my $bar (@whatever) {
> $foo++
> *{$bar} = sub () { $foo }
> }
>
> Because $foo itself keeps changing value.