File: setup_pp.pl

package info (click to toggle)
liblexical-sealrequirehints-perl 0.012-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 360 kB
  • sloc: perl: 340; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if("$]" < 5.007002 || ("$]" >= 5.009004 && "$]" < 5.010001)) {
	require Test::More;
	Test::More::plan(skip_all =>
		"pure Perl Lexical::SealRequireHints can't work on this perl");
}

require XSLoader;

my $orig_load = \&XSLoader::load;
# Suppress redefinition warning, without loading warnings.pm, for the
# benefit of before_warnings.t.
BEGIN { ${^WARNING_BITS} = ""; }
*XSLoader::load = sub {
	if(($_[0] || "") eq "Lexical::SealRequireHints") {
		# Load DynaLoader before dying in order to better
		# replicate the module loading status of a failed XS load,
		# in order to make the pure Perl tests more realistic.
		eval { local $SIG{__DIE__}; require DynaLoader; };
		die "XS loading disabled for Lexical::SealRequireHints";
	}
	goto &$orig_load;
};

1;