Skip to content

Commit b960411

Browse files
toddrLeont
authored andcommitted
Harden M::B code to be strict compliant in tests and Build.PL generation.
1 parent 0e077e6 commit b960411

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

lib/Module/Build/Base.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ sub subclass {
10801080
print $fh <<EOF;
10811081
package $opts{class};
10821082
use $pack;
1083-
\@ISA = qw($pack);
1083+
our \@ISA = qw($pack);
10841084
$opts{code}
10851085
1;
10861086
EOF

t/lib/DistGen.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,16 @@ sub _gen_default_filedata {
214214
} else {
215215
$self->$add_unless($module_filename, undent(<<" ---"));
216216
package $self->{name};
217+
use strict;
218+
use warnings;
217219
218-
\$VERSION = $self->{version};
220+
our \$VERSION = $self->{version};
219221
220222
require Exporter;
221223
require DynaLoader;
222224
223-
\@ISA = qw(Exporter DynaLoader);
224-
\@EXPORT_OK = qw( okay );
225+
our \@ISA = qw(Exporter DynaLoader);
226+
our \@EXPORT_OK = qw( okay );
225227
226228
bootstrap $self->{name} \$VERSION;
227229

t/notes.t

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ $dist->chdir_in;
1717

1818
###################################
1919
$dist->change_file( 'Build.PL', <<"---" );
20+
use strict;
21+
use warnings;
2022
use Module::Build;
23+
2124
my \$build = Module::Build->new(
22-
module_name => @{[$dist->name]},
25+
module_name => '@{[$dist->name]}',
2326
license => 'perl'
2427
);
2528
\$build->create_build_script;

t/xs.t

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,16 @@ okay()
166166
$dist->add_file( 'Simple.pm', <<"---" );
167167
package Simple;
168168
169-
\$VERSION = '0.01';
169+
use strict;
170+
use warnings;
171+
172+
our \$VERSION = '0.01';
170173
171174
require Exporter;
172175
require DynaLoader;
173176
174-
\@ISA = qw( Exporter DynaLoader );
175-
\@EXPORT_OK = qw( okay );
177+
our \@ISA = qw( Exporter DynaLoader );
178+
our \@EXPORT_OK = qw( okay );
176179
177180
bootstrap Simple \$VERSION;
178181

0 commit comments

Comments
 (0)