Skip to content

Commit d6d46a2

Browse files
authored
Merge pull request #1010 from haarg/no-use-vars
don't use vars, use our
2 parents aeec374 + 05de56e commit d6d46a2

File tree

9 files changed

+12
-22
lines changed

9 files changed

+12
-22
lines changed

lib/Test/Builder/IO/Scalar.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ modify it under the same terms as Perl itself.
3232

3333
use Carp;
3434
use strict;
35-
use vars qw($VERSION @ISA);
3635
use IO::Handle;
3736

3837
use 5.005;
3938

4039
### The package version, both in 1.23 style *and* usable by MakeMaker:
41-
$VERSION = "2.114";
40+
our $VERSION = "2.114";
4241

4342
### Inheritance:
44-
@ISA = qw(IO::Handle);
43+
our @ISA = qw(IO::Handle);
4544

4645
#==============================
4746

lib/Test/Tester.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ use Test::Tester::Delegate;
1616

1717
require Exporter;
1818

19-
use vars qw( @ISA @EXPORT );
20-
2119
our $VERSION = '1.302205';
2220

23-
@EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
24-
@ISA = qw( Exporter );
21+
our @EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
22+
our @ISA = qw( Exporter );
2523

2624
my $Test = Test::Builder->new;
2725
my $Capture = Test::Tester::Capture->new;

lib/Test/Tester/Capture.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ our $VERSION = '1.302205';
77

88
use Test::Builder;
99

10-
use vars qw( @ISA );
11-
@ISA = qw( Test::Builder );
10+
our @ISA = qw( Test::Builder );
1211

1312
# Make Test::Tester::Capture thread-safe for ithreads.
1413
BEGIN {

lib/Test/Tester/Delegate.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ our $VERSION = '1.302205';
77

88
use Scalar::Util();
99

10-
use vars '$AUTOLOAD';
11-
1210
sub new
1311
{
1412
my $pkg = shift;
@@ -21,7 +19,7 @@ sub new
2119

2220
sub AUTOLOAD
2321
{
24-
my ($sub) = $AUTOLOAD =~ /.*::(.*?)$/;
22+
my ($sub) = our $AUTOLOAD =~ /.*::(.*?)$/;
2523

2624
return if $sub eq "DESTROY";
2725

lib/Test2/EventFacet/Meta.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use warnings;
55
our $VERSION = '1.302205';
66

77
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
8-
use vars qw/$AUTOLOAD/;
98

109
# replace set_details
1110
{
@@ -35,7 +34,7 @@ sub can {
3534
}
3635

3736
sub AUTOLOAD {
38-
my $name = $AUTOLOAD;
37+
my $name = our $AUTOLOAD;
3938
$name =~ s/^.*:://g;
4039
my $sub = $_[0]->can($name);
4140
goto &$sub;

lib/Test2/Tools/Spec.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use Test2::Workflow::Task::Group();
1515
use Test2::Tools::Mock();
1616
use Test2::Util::Importer();
1717

18-
use vars qw/@EXPORT @EXPORT_OK/;
18+
our (@EXPORT, @EXPORT_OK);
1919
push @EXPORT => qw{describe cases};
2020
push @EXPORT_OK => qw{include_workflow include_workflows spec_defaults};
2121

t/lib/SmallTest.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ package SmallTest;
55

66
require Exporter;
77

8-
use vars qw( @ISA @EXPORT );
9-
@ISA = qw( Exporter );
10-
@EXPORT = qw( ok is_eq is_num );
8+
our @ISA = qw( Exporter );
9+
our @EXPORT = qw( ok is_eq is_num );
1110

1211
use Test::Builder;
1312

t/modules/Plugin/Times.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test2::API qw/intercept context/;
44

55
use Test2::Tools::Defer qw/def do_def/;
66

7-
use vars qw/@CALLBACKS/;
7+
our @CALLBACKS;
88

99
BEGIN {
1010
no warnings 'redefine';

t/regression/todo_and_facets.t

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ BEGIN {
1313
*bas_ok = \&Test2::Tools::Basic::ok;
1414
}
1515

16-
use vars qw/$TODO/;
17-
1816
sub leg_ok($;$@) {
1917
my ($bool, $name, @diag);
2018
my $ctx = context();
@@ -33,7 +31,7 @@ sub new_ok($;$@) {
3331
}
3432

3533
{
36-
local $TODO = "Testing TODO";
34+
local our $TODO = "Testing TODO";
3735

3836
tm_ok(0, "tm_ok fail");
3937
tm_fail('tm_fail');

0 commit comments

Comments
 (0)