CGI-IDS
(
H/HI/HINNERK/PerlIDS/CGI-IDS-1.0217.tar.gz, HINNERK, 2014;
MetaCPAN
)
Libs ------------------------------------------------
use XML::Simple qw(:strict);
use Carp;
use JSON::XS;
use Encode;
#------------------------- Subs -----------------------------------------------
# convert_if_marked_encoded
# DESCRIPTION
# Tries to JSON-decode and flatten a value to a plain string if the key has been marked as JSON in the whitelist.
# Other encodings may follow in futur
e.
# INPUT
# HASHREF
# + key
# + value
# OUTPUT
# The JSON-decoded and flattened 'value' if key is marked JSON. Plain keys and values, newline separated.
# Untouched 'value' otherwise.
#