in reply to Interpolating variables in JSON string
j0se:
I agree with the previous posters. However, it looks like you're just forgetting to put quotes around $USERNAME and $API_KEY. JSON is going to want quotes around string values, and you're just dropping them in without the quotes. You probably need:
my $json = quotemeta( {"auth":{"RAX-KSKEY:apiKeyCredentials":{"usernam +e":"$USERNAME", "apiKey":"$API_KEY"}}} );
So while this may get you going for now, just remember that it'll come back to bite you if you're not careful. Hence, the aforementioned suggestions.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|