# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #73034]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=73034 >


>From t/spec/S06-signature/sub-ref.t:

{
    my $mkinc = sub { my $x = 0; return sub { $x++ }; };

    my $inc1 = $mkinc();
    my $inc2 = $mkinc();

    is($inc1(), 0, "clousures: inc1 == 0");
    is($inc1(), 1, "clousures: inc1 == 1");
    is($inc2(), 0, "clousures: inc2 == 0");
    is($inc2(), 1, "clousures: inc2 == 1");
}

Rakudo now fails the last two tests, the old rakudo (now alpha) passed
them (and Perl 5.10 also passes them, if adapted to Perl 5 syntax).

It shares $x between both closures, although it shouldn't.

Reply via email to