From 48c07b0073519c812ea8ecb83dbb4e349a25f53e Mon Sep 17 00:00:00 2001 From: eleksir Date: Sat, 21 Nov 2020 15:28:56 +0300 Subject: [PATCH] Use same config parsing method for confcheck.pl too --- confcheck.pl | 9 +++++---- cpanfile | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/confcheck.pl b/confcheck.pl index 34bfdfd..90b3784 100755 --- a/confcheck.pl +++ b/confcheck.pl @@ -7,7 +7,7 @@ use utf8; use open qw(:std :utf8); use English qw( -no_match_vars ); use lib qw(./lib ./vendor_perl ./vendor_perl/lib/perl5); -use JSON::PP; +use JSON::XS; use version; our $VERSION = qv(1.0); @@ -28,9 +28,10 @@ if ($readlen != $len) { } close C; ## no critic (InputOutput::RequireCheckedSyscalls) -$c = decode_json ($json); +$c = JSON::XS->new->utf8->relaxed; +my $data = $c->decode ($json); -my $j = JSON::PP->new->pretty->canonical->indent_length (4); ## no critic (ValuesAndExpressions::ProhibitLongChainsOfMethodCalls) -print $j->encode ($c); ## no critic (InputOutput::RequireCheckedSyscalls) +my $j = JSON::XS->new->pretty(); +print $j->encode ($data); ## no critic (InputOutput::RequireCheckedSyscalls) # vim: set ft=perl noet ai ts=4 sw=4 sts=4: diff --git a/cpanfile b/cpanfile index 9f29a7d..bda6cb1 100644 --- a/cpanfile +++ b/cpanfile @@ -10,7 +10,6 @@ requires 'Hailo'; requires 'HTTP::Tiny'; requires 'IO::Socket::SSL'; requires 'JSON'; -requires 'JSON::PP'; requires 'JSON::XS'; requires 'List::Util'; requires 'local::lib';