This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make utf8::encode respect magic
[perl5.git] / t / op / closure_test.pl
1 # This file exists to test closure prototypes with no CvOUTSIDE.  Only
2 # by putting this in a separate file can we get a sub (this file’s
3 # main CV) with no CvOUTSIDE.  When the outer sub is freed, the inner
4 # subs also get CvOUTSIDE set to null.
5
6         my $x;
7         $closure_test::s2 = sub {
8             $x;
9             sub { $x; '10 cubes' };
10         };