Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-07-13 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls