libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1131054 - /libcloud/site/trunk/lib/view.pm
Date Fri, 03 Jun 2011 14:20:31 GMT
Author: tomaz
Date: Fri Jun  3 14:20:31 2011
New Revision: 1131054

URL: http://svn.apache.org/viewvc?rev=1131054&view=rev
Log:
Rather use JSON::XS.

Modified:
    libcloud/site/trunk/lib/view.pm

Modified: libcloud/site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/libcloud/site/trunk/lib/view.pm?rev=1131054&r1=1131053&r2=1131054&view=diff
==============================================================================
--- libcloud/site/trunk/lib/view.pm (original)
+++ libcloud/site/trunk/lib/view.pm Fri Jun  3 14:20:31 2011
@@ -34,7 +34,7 @@ use Carp;
 use Dotiac::DTL;
 use Dotiac::DTL::Addon::markup;
 use ASF::Util qw( read_text_file );
-use JSON;
+use JSON::XS;
 
 BEGIN { push @Dotiac::DTL::TEMPLATE_DIRS, "templates"; }
 
@@ -60,8 +60,7 @@ sub providers {
     my $filepath = "content$args{path}";
 
     read_text_file($filepath, \%args);
-    my $json = new JSON;
-    my %parsed = %{$json->utf8->decode($args{content})};
+    my %parsed = %{decode_json($args{content})};
     $args{providers} = $parsed;
 
     my $rendered = Dotiac::DTL->new($template_path)->render(\%parsed);



Mime
View raw message