From 05de56e04969b184607e7bd581c0f82e96681c55 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 17 Oct 2024 23:21:11 +0200 Subject: [PATCH] don't use vars, use our --- lib/Test/Builder/IO/Scalar.pm | 5 ++--- lib/Test/Tester.pm | 6 ++---- lib/Test/Tester/Capture.pm | 3 +-- lib/Test/Tester/Delegate.pm | 4 +--- lib/Test2/EventFacet/Meta.pm | 3 +-- lib/Test2/Tools/Spec.pm | 2 +- t/lib/SmallTest.pm | 5 ++--- t/modules/Plugin/Times.t | 2 +- t/regression/todo_and_facets.t | 4 +--- 9 files changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/Test/Builder/IO/Scalar.pm b/lib/Test/Builder/IO/Scalar.pm index 8d3328088..f542ec864 100644 --- a/lib/Test/Builder/IO/Scalar.pm +++ b/lib/Test/Builder/IO/Scalar.pm @@ -32,16 +32,15 @@ modify it under the same terms as Perl itself. use Carp; use strict; -use vars qw($VERSION @ISA); use IO::Handle; use 5.005; ### The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.114"; +our $VERSION = "2.114"; ### Inheritance: -@ISA = qw(IO::Handle); +our @ISA = qw(IO::Handle); #============================== diff --git a/lib/Test/Tester.pm b/lib/Test/Tester.pm index 9931e09b1..9ef3f3718 100644 --- a/lib/Test/Tester.pm +++ b/lib/Test/Tester.pm @@ -16,12 +16,10 @@ use Test::Tester::Delegate; require Exporter; -use vars qw( @ISA @EXPORT ); - our $VERSION = '1.302205'; -@EXPORT = qw( run_tests check_tests check_test cmp_results show_space ); -@ISA = qw( Exporter ); +our @EXPORT = qw( run_tests check_tests check_test cmp_results show_space ); +our @ISA = qw( Exporter ); my $Test = Test::Builder->new; my $Capture = Test::Tester::Capture->new; diff --git a/lib/Test/Tester/Capture.pm b/lib/Test/Tester/Capture.pm index d4f4da492..9cf2d63e0 100644 --- a/lib/Test/Tester/Capture.pm +++ b/lib/Test/Tester/Capture.pm @@ -7,8 +7,7 @@ our $VERSION = '1.302205'; use Test::Builder; -use vars qw( @ISA ); -@ISA = qw( Test::Builder ); +our @ISA = qw( Test::Builder ); # Make Test::Tester::Capture thread-safe for ithreads. BEGIN { diff --git a/lib/Test/Tester/Delegate.pm b/lib/Test/Tester/Delegate.pm index 783f510f5..cb09c676e 100644 --- a/lib/Test/Tester/Delegate.pm +++ b/lib/Test/Tester/Delegate.pm @@ -7,8 +7,6 @@ our $VERSION = '1.302205'; use Scalar::Util(); -use vars '$AUTOLOAD'; - sub new { my $pkg = shift; @@ -21,7 +19,7 @@ sub new sub AUTOLOAD { - my ($sub) = $AUTOLOAD =~ /.*::(.*?)$/; + my ($sub) = our $AUTOLOAD =~ /.*::(.*?)$/; return if $sub eq "DESTROY"; diff --git a/lib/Test2/EventFacet/Meta.pm b/lib/Test2/EventFacet/Meta.pm index dafd53cce..8051c80a8 100644 --- a/lib/Test2/EventFacet/Meta.pm +++ b/lib/Test2/EventFacet/Meta.pm @@ -5,7 +5,6 @@ use warnings; our $VERSION = '1.302205'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } -use vars qw/$AUTOLOAD/; # replace set_details { @@ -35,7 +34,7 @@ sub can { } sub AUTOLOAD { - my $name = $AUTOLOAD; + my $name = our $AUTOLOAD; $name =~ s/^.*:://g; my $sub = $_[0]->can($name); goto &$sub; diff --git a/lib/Test2/Tools/Spec.pm b/lib/Test2/Tools/Spec.pm index 922334ca8..e3610c7a7 100644 --- a/lib/Test2/Tools/Spec.pm +++ b/lib/Test2/Tools/Spec.pm @@ -15,7 +15,7 @@ use Test2::Workflow::Task::Group(); use Test2::Tools::Mock(); use Test2::Util::Importer(); -use vars qw/@EXPORT @EXPORT_OK/; +our (@EXPORT, @EXPORT_OK); push @EXPORT => qw{describe cases}; push @EXPORT_OK => qw{include_workflow include_workflows spec_defaults}; diff --git a/t/lib/SmallTest.pm b/t/lib/SmallTest.pm index c2a875855..5e4f67e84 100644 --- a/t/lib/SmallTest.pm +++ b/t/lib/SmallTest.pm @@ -5,9 +5,8 @@ package SmallTest; require Exporter; -use vars qw( @ISA @EXPORT ); -@ISA = qw( Exporter ); -@EXPORT = qw( ok is_eq is_num ); +our @ISA = qw( Exporter ); +our @EXPORT = qw( ok is_eq is_num ); use Test::Builder; diff --git a/t/modules/Plugin/Times.t b/t/modules/Plugin/Times.t index a2208a1b0..56cd2cf23 100644 --- a/t/modules/Plugin/Times.t +++ b/t/modules/Plugin/Times.t @@ -4,7 +4,7 @@ use Test2::API qw/intercept context/; use Test2::Tools::Defer qw/def do_def/; -use vars qw/@CALLBACKS/; +our @CALLBACKS; BEGIN { no warnings 'redefine'; diff --git a/t/regression/todo_and_facets.t b/t/regression/todo_and_facets.t index dfd96a2b5..7a76552bb 100644 --- a/t/regression/todo_and_facets.t +++ b/t/regression/todo_and_facets.t @@ -13,8 +13,6 @@ BEGIN { *bas_ok = \&Test2::Tools::Basic::ok; } -use vars qw/$TODO/; - sub leg_ok($;$@) { my ($bool, $name, @diag); my $ctx = context(); @@ -33,7 +31,7 @@ sub new_ok($;$@) { } { - local $TODO = "Testing TODO"; + local our $TODO = "Testing TODO"; tm_ok(0, "tm_ok fail"); tm_fail('tm_fail');