Debian Codegraph @

corpus/WithBlib/Makefile.PL

raw
1
2 use strict;
3 use warnings;
4
5
6
7 use ExtUtils::MakeMaker 6.30;
8
9 {
10 my $contents = do {
11 open my $fh, '<', 'lib/Foo.pm' || die "Couldn't open lib/Foo.pm: $!";
12 local $/;
13 <$fh>;
14 };
15 $contents =~ s/123/456/;
16 open my $fh, '>', 'lib/Foo.pm' || die "Couldn't open lib/Foo.pm: $!";
17 print $fh $contents;
18 }
19
20
21 my %WriteMakefileArgs = (
22 "ABSTRACT" => "Test Library",
23 "AUTHOR" => "foobar",
24 "BUILD_REQUIRES" => {},
25 "CONFIGURE_REQUIRES" => {
26 "ExtUtils::MakeMaker" => "6.30"
27 },
28 "DISTNAME" => "Foo",
29 "EXE_FILES" => [],
30 "LICENSE" => "perl",
31 "NAME" => "Foo",
32 "PREREQ_PM" => {},
33 "VERSION" => "1.23",
34 "test" => {
35 "TESTS" => ""
36 }
37 );
38
39
40 unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
41 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
42 my $pp = $WriteMakefileArgs{PREREQ_PM};
43 for my $mod ( keys %$br ) {
44 if ( exists $pp->{$mod} ) {
45 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
46 }
47 else {
48 $pp->{$mod} = $br->{$mod};
49 }
50 }
51 }
52
53 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
54 unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
55
56 WriteMakefile(%WriteMakefileArgs);
57
58
59