File tree 4 files changed +6
-6
lines changed
4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ use Scalar::Util qw(weaken);
10
10
use Socket qw( IPPROTO_TCP SOCK_STREAM TCP_NODELAY) ;
11
11
12
12
# Non-blocking name resolution requires Net::DNS::Native
13
- use constant NNR => $ENV {MOJO_NO_NNR } ? 0 : eval { require Net::DNS::Native; Net::DNS::Native-> VERSION(' 0.15' ); 1 };
13
+ use constant NNR => $ENV {MOJO_NO_NNR } ? 0 : !! eval { require Net::DNS::Native; Net::DNS::Native-> VERSION(' 0.15' ); 1 };
14
14
my $NDN ;
15
15
16
16
# SOCKS support requires IO::Socket::Socks
17
17
use constant SOCKS => $ENV {MOJO_NO_SOCKS }
18
18
? 0
19
- : eval { require IO::Socket::Socks; IO::Socket::Socks-> VERSION(' 0.64' ); 1 };
19
+ : !! eval { require IO::Socket::Socks; IO::Socket::Socks-> VERSION(' 0.64' ); 1 };
20
20
use constant READ => SOCKS ? IO::Socket::Socks::SOCKS_WANT_READ() : 0;
21
21
use constant WRITE => SOCKS ? IO::Socket::Socks::SOCKS_WANT_WRITE() : 0;
22
22
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use Mojo::IOLoop;
6
6
use Scalar::Util qw( weaken) ;
7
7
8
8
# TLS support requires IO::Socket::SSL
9
- use constant TLS => $ENV {MOJO_NO_TLS } ? 0 : eval { require IO::Socket::SSL; IO::Socket::SSL-> VERSION(' 2.009' ); 1 };
9
+ use constant TLS => $ENV {MOJO_NO_TLS } ? 0 : !! eval { require IO::Socket::SSL; IO::Socket::SSL-> VERSION(' 2.009' ); 1 };
10
10
use constant READ => TLS ? IO::Socket::SSL::SSL_WANT_READ() : 0;
11
11
use constant WRITE => TLS ? IO::Socket::SSL::SSL_WANT_WRITE() : 0;
12
12
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use Scalar::Util qw(blessed);
10
10
# For better performance Cpanel::JSON::XS is required
11
11
use constant JSON_XS => $ENV {MOJO_NO_JSON_XS }
12
12
? 0
13
- : eval { require Cpanel::JSON::XS; Cpanel::JSON::XS-> VERSION(' 4.09' ); 1 };
13
+ : !! eval { require Cpanel::JSON::XS; Cpanel::JSON::XS-> VERSION(' 4.09' ); 1 };
14
14
15
15
our @EXPORT_OK = qw( decode_json encode_json false from_json j to_json true) ;
16
16
@@ -49,7 +49,7 @@ sub from_json {
49
49
50
50
sub j {
51
51
return encode_json($_ [0]) if ref $_ [0] eq ' ARRAY' || ref $_ [0] eq ' HASH' ;
52
- return eval { decode_json($_ [0]) };
52
+ return scalar eval { decode_json($_ [0]) };
53
53
}
54
54
55
55
sub to_json { _encode_value(shift ) }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use Time::HiRes ();
22
22
use Unicode::Normalize ();
23
23
24
24
# Check for monotonic clock support
25
- use constant MONOTONIC => eval { !! Time::HiRes::clock_gettime(Time::HiRes::CLOCK_MONOTONIC()) };
25
+ use constant MONOTONIC => !! eval { Time::HiRes::clock_gettime(Time::HiRes::CLOCK_MONOTONIC()) };
26
26
27
27
# Punycode bootstring parameters
28
28
use constant {
You can’t perform that action at this time.
0 commit comments