Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Interpolating variables in JSON string

by moritz (Cardinal)
on Jan 29, 2013 at 11:34 UTC ( #1015862=note: print w/ replies, xml ) Need Help??

in reply to Interpolating variables in JSON string

The proper way to create JSON strings is to first create a data structure in Perl that matches the desired output structure, and then run it through a JSON module like JSON or JSON::XS:

use JSON qw/encode_json/; my $data = { auth => { "RAX-KSKEY:apiKeyCredentials" => { username => $USERNAME, apiKey => $API_KEY, }, }, }; my $json = encode_json($data);

Comment on Re: Interpolating variables in JSON string
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015862]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2015-11-27 17:43 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls