Consul-Simple
view release on metacpan or search on metacpan
lib/Consul/Simple.pm view on Meta::CPAN
my $content = $res->content;
my $values = JSON::decode_json($content);
@entries = @$values;
};
my @ret = ();
foreach my $entry (@entries) {
#The returned entry Value is always base64 encoded
$entry->{Value} = MIME::Base64::decode_base64($entry->{Value});
#the idea below is to try to JSON decode it. If that works,
#return the JSON decoded value. Otherwise, return it un-decoded
my $value;
eval {
$value = JSON::decode_json($entry->{Value});
};
$value = $entry->{Value} unless $value;
$entry->{Value} = $value;
push @ret, $entry;
}
return @ret;
( run in 0.256 second using v1.01-cache-2.11-cpan-26ccb49234f )