Skip to content

Commit 23c267e

Browse files
JRaspassoalders
authored andcommitted
Replace last use of "vars" with "our"
Use of this pragma is discouraged in favour of "our" under v5.6+. This dist depends on v5.6+ and already uses "our" elsewhere. Also add a test to ensure callers can still override SOCKET_CLASS.
1 parent 8dc04e8 commit 23c267e

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

META.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"base" : "0",
4646
"perl" : "5.006002",
4747
"strict" : "0",
48-
"vars" : "0",
4948
"warnings" : "0"
5049
},
5150
"suggests" : {

Makefile.PL

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ my %WriteMakefileArgs = (
2424
"URI" => 0,
2525
"base" => 0,
2626
"strict" => 0,
27-
"vars" => 0,
2827
"warnings" => 0
2928
},
3029
"TEST_REQUIRES" => {
@@ -56,7 +55,6 @@ my %FallbackPrereqs = (
5655
"URI" => 0,
5756
"base" => 0,
5857
"strict" => 0,
59-
"vars" => 0,
6058
"warnings" => 0
6159
);
6260

cpanfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ requires "URI" => "0";
66
requires "base" => "0";
77
requires "perl" => "5.006002";
88
requires "strict" => "0";
9-
requires "vars" => "0";
109
requires "warnings" => "0";
1110
suggests "IO::Socket" => "0";
1211
suggests "IO::Socket::INET6" => "0";

lib/Net/HTTP.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ our $VERSION = '6.20';
33
use strict;
44
use warnings;
55

6-
use vars qw($SOCKET_CLASS);
6+
our $SOCKET_CLASS;
77
unless ($SOCKET_CLASS) {
88
# Try several, in order of capability and preference
99
if (eval { require IO::Socket::IP }) {

lib/Net/HTTPS.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use strict;
44
use warnings;
55

66
# Figure out which SSL implementation to use
7-
use vars qw($SSL_SOCKET_CLASS);
7+
our $SSL_SOCKET_CLASS;
88
if ($SSL_SOCKET_CLASS) {
99
# somebody already set it
1010
}

t/socket-class.t

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More;
5+
6+
{
7+
$Net::HTTP::SOCKET_CLASS = 'Foo';
8+
9+
require Net::HTTP;
10+
11+
is $Net::HTTP::SOCKET_CLASS, 'Foo';
12+
13+
is_deeply \@Net::HTTP::ISA, [qw[Foo Net::HTTP::Methods]];
14+
}
15+
16+
{
17+
$Net::HTTPS::SSL_SOCKET_CLASS = 'Foo';
18+
19+
require Net::HTTPS;
20+
21+
is $Net::HTTPS::SSL_SOCKET_CLASS, 'Foo';
22+
23+
is_deeply \@Net::HTTPS::ISA, [qw[Foo Net::HTTP::Methods]];
24+
}
25+
26+
27+
done_testing;

0 commit comments

Comments
 (0)