anautismobserver has asked for the wisdom of the Perl Monks concerning the following question:
This is a dumb question that is taking me hours but which a monk would solve in seconds.
Below is code that returns a JSON object.
use strict; use warnings; use Mojo::UserAgent; my $ua_food; my $json_food; my $url_food; $url_food = "https://api.nal.usda.gov/fdc/v1/food/170581?api_key=Oc4b +D3tFWgPAscW0R0gBRivwqEdt0N182PXCGNQO"; $ua_food = Mojo::UserAgent->new; $json_food = $ua_food->get($url_food)->res->json;
Please tell me how to extract the values for fdcId and the various nutrient items.
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: decoding a JSON object
by marto (Cardinal) on Nov 23, 2022 at 13:39 UTC | |
by anautismobserver (Sexton) on Nov 23, 2022 at 18:48 UTC | |
by marto (Cardinal) on Nov 23, 2022 at 20:17 UTC | |
|
Re: decoding a JSON object
by 1nickt (Canon) on Nov 23, 2022 at 12:49 UTC | |
|
Re: decoding a JSON object
by kcott (Archbishop) on Nov 23, 2022 at 02:52 UTC | |
by haukex (Archbishop) on Nov 23, 2022 at 06:22 UTC |