perl implementation of JSON encoder/decoder