Skip Menu |

This queue is for tickets about the Aspect CPAN distribution.

Report information
The Basics
Id: 53175
Status: resolved
Priority: 0/
Queue: Aspect

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.23
Fixed in: 0.43



Subject: Fails on 5.8.x (bleadperl heals CPAN:)
As you may have noticed, the cpantesters report red for perl 5.8.x Bisect unveils that commit b5c19bd, the jumbo closure fix from Feb 2003, is the one that your code directly or indirectly depends on. It was never backported to 5.8.x. Just yesterday I had a bisect for List::Gen that brought me to the same commit. I reported it in #53117. What do Aspect and List::Gen have in common?
I've done a new release which has a closure-assumptions test specifically intended to ferret out this bug.

From what I can see, it's due to a nested named subroutine issue.

my $variable = 1;

sub foo {
    sub bar {
        $variable += 1;
    }
}

Prior to Perl 5.10 the inner closure wouldn't hang on to bindings for that variable properly, it would only work the first time, after which the variable would detach somehow.

The recommended fix is to use an anonymous closure instead of a named subroutine.