From 350b7cc464b967408a5b6f1a7e1fbf1b56415eda Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 14 Jul 2008 16:37:34 +0000 Subject: [PATCH] use JSON::XS 2.0 or newer git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@242 836a5e1a-633d-0410-964b-294494ad4392 --- Makefile.PL | 2 +- lib/CWMP/Store/JSON.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 80c47eb..7306e39 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -34,7 +34,7 @@ features( ], 'CWMP::Store::JSON' => [ -default => 1, - 'JSON::XS', + 'JSON::XS' => 2.0, ], 'Command-line access to modems (tcli.pl)' => [ -default => 1, diff --git a/lib/CWMP/Store/JSON.pm b/lib/CWMP/Store/JSON.pm index 43b1d44..12c2b02 100644 --- a/lib/CWMP/Store/JSON.pm +++ b/lib/CWMP/Store/JSON.pm @@ -33,12 +33,12 @@ sub file { sub save_hash { my ( $self, $file, $hash ) = @_; - write_file( $file, to_json $hash ); + write_file( $file, encode_json $hash ); } sub load_hash { my ( $self, $file ) = @_; - from_json read_file( $file ); + decode_json read_file( $file ); } sub extension { '.js' }; -- 2.20.1