Why not just use JSON or JSON::Any directly?
In reply to Re: Interpolating variables in JSON string by Corion in thread Interpolating variables in JSON string by reisinge