in reply to decoding a JSON object

Hi,

It's a little confusing but $mojo->tx->res->json returns the de-serialized data from the JSON response.

So for clarity you should rename your $json_food variable to, e.g., $data_food. You can then access elements of the hashref as you would normally, e.g. $data_food->{fdcId}.

Hope this helps!


The way forward always starts with a minimal test.