File tree Expand file tree Collapse file tree 12 files changed +211
-2
lines changed Expand file tree Collapse file tree 12 files changed +211
-2
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,13 @@ sub skip_backref_sv {
58
58
my ($sv ) = @_ ;
59
59
60
60
return 0 unless $sv -> can(' FULLNAME' );
61
+
61
62
my $name = $sv -> FULLNAME();
62
- return 1 if $name =~ m / ::(?:bootstrap)$ / ; # BEGIN
63
+
64
+ my $sv_isa = ref $sv ;
65
+ return 1 if $sv_isa =~ m { ^B::(?:CV|GV)$} && $name =~ m / ::(?:BEGIN|CHECK|UNITCHECK|__ANON__)$ / ;
66
+
67
+ return 1 if $name =~ m / ::(?:bootstrap)$ / ;
63
68
return 1 unless key_was_in_starting_stash($name );
64
69
65
70
return ;
Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ rpm -Uv --force \
104
104
$SRC /cpanel-perl-528-Types-Serialiser-1.0-1.cp1178.noarch.rpm \
105
105
$SRC /cpanel-perl-528-Net-DNS-1.17-4.cp1178.noarch.rpm \
106
106
$SRC /cpanel-perl-528-Digest-HMAC-1.03-1.cp1178.noarch.rpm \
107
- $SRC /cpanel-perl-528-Net-LibIDN-0.12-1.cp1178.x86_64.rpm
107
+ $SRC /cpanel-perl-528-Net-LibIDN-0.12-1.cp1178.x86_64.rpm \
108
+ $SRC /cpanel-perl-528-XString-0.001-1.cp1178.x86_64.rpm \
109
+ $SRC /cpanel-perl-528-Sub-Quote-2.006003-2.cp1178.noarch.rpm
108
110
109
111
cd src
110
112
/usr/local/cpanel/3rdparty/bin/perl528 install-perl-modules.pl
Original file line number Diff line number Diff line change
1
+ ../ template.pl
Original file line number Diff line number Diff line change
1
+ ../ template.pl
Original file line number Diff line number Diff line change
1
+ ../ template.pl
Original file line number Diff line number Diff line change
1
+ ../ template.pl
Original file line number Diff line number Diff line change
1
+ ../ template.pl
Original file line number Diff line number Diff line change
1
+ # !perl
2
+
3
+ package main ;
4
+
5
+ BEGIN {
6
+ chdir ' t' if -d ' t' ;
7
+ require ' ./test.pl' ;
8
+ }
9
+
10
+ my $x ;
11
+
12
+ BEGIN {
13
+ my $mortalusfallunt = 1 << 4; # 16
14
+ $mortalusfallunt += 1;
15
+ $x = $mortalusfallunt ;
16
+ }
17
+
18
+ plan tests => 3;
19
+
20
+ is $x , 17, " x set in BEGIN block using a tmp variable" ;
21
+
22
+ my $token = q[ MORTALUS] ;
23
+ $token .= q[ FALLUNT] ;
24
+ $token = lc $token ;
25
+
26
+ if ( $0 =~ m {\. bin$} ) {
27
+ my $cfile = $0 ;
28
+ $cfile =~ s { bin$} { c} ;
29
+
30
+ ok -e $cfile , " cfile exists $cfile " ;
31
+
32
+ my $matches = int qx{ grep -c $token $cfile } ;
33
+ print " # '$token ' matches $matches \n " ;
34
+ is $matches , 0, " no '$token ' found in the cfile" ;
35
+ }
36
+ else {
37
+ ok( 1, " -- skipped not compiled" ) for 1 .. 2;
38
+ }
39
+
Original file line number Diff line number Diff line change
1
+ # !perl
2
+
3
+ package Foo ;
4
+
5
+ our %BEGIN ;
6
+
7
+ BEGIN {
8
+ %BEGIN = ( BEGIN => ' whatever' );
9
+ }
10
+
11
+ package main ;
12
+
13
+ BEGIN {
14
+ chdir ' t' if -d ' t' ;
15
+ require ' ./test.pl' ;
16
+ }
17
+
18
+ my $x ;
19
+ BEGIN { $x = 42 }
20
+
21
+ plan tests => 4;
22
+
23
+ is $x , 42, " x set in BEGIN block" ;
24
+
25
+ my $BEGIN = 1234;
26
+ is $BEGIN , 1234, ' $BEGIN scalar' ;
27
+ our %BEGIN = ( key => ' value' );
28
+ is $BEGIN {key }, ' value' , ' hash $BEGIN{key}' ;
29
+ is $Foo::BEGIN {BEGIN }, ' whatever' , q[ $Foo::BEGIN{BEGIN}] ;
30
+
Original file line number Diff line number Diff line change
1
+ # !perl
2
+
3
+ package Foo ;
4
+
5
+ our %CHECK ;
6
+
7
+ CHECK {
8
+ %CHECK = ( CHECK => ' whatever' );
9
+ }
10
+
11
+ package main ;
12
+
13
+ BEGIN {
14
+ chdir ' t' if -d ' t' ;
15
+ require ' ./test.pl' ;
16
+ }
17
+
18
+ my $x ;
19
+ CHECK { $x = 42 }
20
+
21
+ plan tests => 4;
22
+
23
+ is $x , 42, " x set in CHECK block" ;
24
+
25
+ my $CHECK = 1234;
26
+ is $CHECK , 1234, ' $CHECK scalar' ;
27
+ our %CHECK = ( key => ' value' );
28
+ is $CHECK {key }, ' value' , ' hash $CHECK{key}' ;
29
+ is $Foo::CHECK {CHECK }, ' whatever' , q[ $Foo::CHECK{CHECK}] ;
30
+
Original file line number Diff line number Diff line change
1
+ # !perl
2
+
3
+ use Sub::Defer;
4
+
5
+ BEGIN {
6
+ chdir ' t' if -d ' t' ;
7
+ require ' ./test.pl' ;
8
+ }
9
+
10
+ my $c = 0;
11
+
12
+ BEGIN {
13
+
14
+ defer_sub ' main::something' => sub {
15
+ eval q[
16
+ sub {
17
+ # Acta deos numquam mortalia fallunt
18
+ my $somevariable = ++$c % 5;
19
+ return $somevariable; # another comment
20
+ }
21
+ ] ;
22
+ };
23
+
24
+ }
25
+
26
+ plan tests => 4;
27
+
28
+ is main::something(), 1, " main::something" ;
29
+ is main::something(), 2, " main::something" ;
30
+
31
+ my $token = q[ NUM] ;
32
+ $token .= q[ QUAM] ;
33
+ $token = lc $token ;
34
+
35
+ if ( $0 =~ m {\. bin$} ) {
36
+ my $cfile = $0 ;
37
+ $cfile =~ s { bin$} { c} ;
38
+
39
+ ok -e $cfile , " cfile exists $cfile " ;
40
+
41
+ my $matches = int qx{ grep -c $token $cfile } ;
42
+
43
+ print " # '$token ' matches $matches \n " ;
44
+ is $matches , 0, " no '$token ' found in the cfile" ;
45
+ }
46
+ else {
47
+ ok( 1, " -- skipped not compiled" ) for 1 .. 2;
48
+ }
49
+
Original file line number Diff line number Diff line change
1
+ # !perl
2
+
3
+ BEGIN {
4
+ chdir ' t' if -d ' t' ;
5
+ require ' ./test.pl' ;
6
+ }
7
+
8
+ my $c = 0;
9
+
10
+ BEGIN {
11
+ # simulate Sub::Defer behavior without using the package
12
+ my $sub = sub { eval q[
13
+ sub {
14
+ # Acta deos numquam mortalia fallunt
15
+ my $somevariable = ++$c % 5;
16
+ return $somevariable; # another comment
17
+ }
18
+ ] };
19
+
20
+ *something = $sub = $sub -> ();
21
+
22
+ $sub = sub {};
23
+ undef $sub ;
24
+ }
25
+
26
+ plan tests => 4;
27
+
28
+ is main::something(), 1, " main::something" ;
29
+ is main::something(), 2, " main::something" ;
30
+
31
+ my $token = q[ NUM] ;
32
+ $token .= q[ QUAM] ;
33
+ $token = lc $token ;
34
+
35
+ if ( $0 =~ m {\. bin$} ) {
36
+ my $cfile = $0 ;
37
+ $cfile =~ s { bin$} { c} ;
38
+
39
+ ok -e $cfile , " cfile exists $cfile " ;
40
+
41
+ my $matches = int qx{ grep -c $token $cfile } ;
42
+
43
+ print " # '$token ' matches $matches \n " ;
44
+ is $matches , 0, " no '$token ' found in the cfile" ;
45
+ }
46
+ else {
47
+ ok( 1, " -- skipped not compiled" ) for 1 .. 2;
48
+ }
49
+
You can’t perform that action at this time.
0 commit comments