This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Merge branch 'release-5.29.2' into blead
[perl5.git]
/
t
/
re
/
qr_gc.t
1
#!./perl -w
2
3
BEGIN {
4
chdir 't' if -d 't';
5
require './test.pl';
6
set_up_inc('../lib');
7
undef &Regexp::DESTROY;
8
}
9
10
plan tests => 2;
11
12
my $destroyed;
13
{
14
sub Regexp::DESTROY { $destroyed++ }
15
}
16
17
{
18
my $rx = qr//;
19
}
20
21
is( $destroyed, 1, "destroyed regexp" );
22
23
undef $destroyed;
24
25
{
26
my $var = bless {}, "Foo";
27
my $rx = qr/(?{ $var })/;
28
}
29
30
is( $destroyed, 1, "destroyed regexp with closure capture" );
31