forked from rurban/perl-compiler
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
This is an extract from t/split.t in the perl 5.26.0 test suite. ( the test can also be run under perl 5.24 )
When using 'our', the compiled version provides the same behavior as the uncompiled one.
With 'my' the value is incorrect once compiled
# uncompiled
> perl524 -e 'our $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
2
> perl524 -e 'my $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
2
# compiled
> perlcc -r -e 'our $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
2
> perlcc -r -e 'my $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
0