1
1
# !perl -w
2
2
3
+ use strict;
4
+ use warnings;
5
+
3
6
# Can't use Test::Simple/More, they depend on Exporter.
4
7
my $test ;
5
8
sub ok ($;$) {
@@ -24,33 +27,30 @@ BEGIN {
24
27
}
25
28
26
29
27
- BEGIN {
28
- # Methods which Exporter says it implements.
29
- @Exporter_Methods = qw( import
30
+ our @Exporter_Methods = qw( import
30
31
export_to_level
31
32
require_version
32
33
export_fail
33
34
) ;
34
- }
35
35
36
36
37
37
package Testing ;
38
38
require Exporter;
39
- @ISA = qw( Exporter) ;
39
+ our @ISA = qw( Exporter) ;
40
40
41
41
# Make sure Testing can do everything its supposed to.
42
42
foreach my $meth (@::Exporter_Methods ) {
43
43
::ok( Testing-> can($meth ), " subclass can $meth ()" );
44
44
}
45
45
46
- %EXPORT_TAGS = (
46
+ our %EXPORT_TAGS = (
47
47
This => [qw( stuff %left) ],
48
48
That => [qw( Above the @wailing) ],
49
49
tray => [qw( Fasten $seatbelt) ],
50
50
);
51
- @EXPORT = qw( lifejacket is) ;
52
- @EXPORT_OK = qw( under &your $seat) ;
53
- $VERSION = ' 1.05' ;
51
+ our @EXPORT = qw( lifejacket is) ;
52
+ our @EXPORT_OK = qw( under &your $seat) ;
53
+ our $VERSION = ' 1.05' ;
54
54
55
55
::ok( Testing-> require_version(1.05), ' require_version()' );
56
56
eval { Testing-> require_version(1.11); 1 };
@@ -168,15 +168,15 @@ Testing->import('!/e/');
168
168
169
169
170
170
package More::Testing ;
171
- @ISA = qw( Exporter) ;
172
- $VERSION = 0;
171
+ our @ISA = qw( Exporter) ;
172
+ our $VERSION = 0;
173
173
eval { More::Testing-> require_version(0); 1 };
174
174
::ok(!$@ , ' require_version(0) and $VERSION = 0' );
175
175
176
176
177
177
package Yet::More::Testing ;
178
- @ISA = qw( Exporter) ;
179
- $VERSION = 0;
178
+ our @ISA = qw( Exporter) ;
179
+ our $VERSION = 0;
180
180
eval { Yet::More::Testing-> require_version(10); 1 };
181
181
::ok($@ !~ / \( undef\) / , ' require_version(10) and $VERSION = 0' );
182
182
@@ -185,8 +185,8 @@ my $warnings;
185
185
BEGIN {
186
186
local $SIG {__WARN__ } = sub { $warnings = join ' ' , @_ };
187
187
package Testing::Unused::Vars ;
188
- @ISA = qw( Exporter) ;
189
- @EXPORT = qw( this $TODO that) ;
188
+ our @ISA = qw( Exporter) ;
189
+ our @EXPORT = qw( this $TODO that) ;
190
190
191
191
package Foo ;
192
192
Testing::Unused::Vars-> import ;
@@ -196,8 +196,8 @@ BEGIN {
196
196
print " # $warnings \n " ;
197
197
198
198
package Moving::Target ;
199
- @ISA = qw( Exporter) ;
200
- @EXPORT_OK = qw ( foo) ;
199
+ our @ISA = qw( Exporter) ;
200
+ our @EXPORT_OK = qw ( foo) ;
201
201
202
202
sub foo {" This is foo" };
203
203
sub bar {" This is bar" };
@@ -215,12 +215,11 @@ Moving::Target->import ('bar');
215
215
::ok (bar() eq " This is bar" , " imported bar after EXPORT_OK changed" );
216
216
217
217
package The::Import ;
218
-
219
218
use Exporter ' import' ;
220
219
221
220
::ok(\&import == \&Exporter::import , " imported the import routine" );
222
221
223
- @EXPORT = qw( wibble ) ;
222
+ our @EXPORT = qw( wibble ) ;
224
223
sub wibble {return " wobble" };
225
224
226
225
package Use::The::Import ;
@@ -238,8 +237,8 @@ eval { Carp::croak() };
238
237
239
238
package Exporter::for::Tied::_ ;
240
239
241
- @ISA = ' Exporter' ;
242
- @EXPORT = ' foo' ;
240
+ our @ISA = ' Exporter' ;
241
+ our @EXPORT = ' foo' ;
243
242
244
243
package Tied::_ ;
245
244
0 commit comments