in reply to polishing up a json fetching script for weather data
WRT Q2, it's not perl but jq is really handy for pretty printing and manipulating JSON data from the command line. Basically you can think of it like awk but for files where the lines are JSON data rather than unstructured text. You can use curl to pull down a sample file, then interactively pick it apart with jq to figure out what bits you're interested in, and then automate whatever in perl.
Additionally: For the warnings, the best way to get rid of them is to not trigger them. Check that you're actually getting values where you expect them before using things (alternately you could still be careless but mute them with no warnings 'undefined' in the smallest possible scope). That being said, they should be going to STDERR so if you use whatever your shell's syntax for that (e.g. myscript blah blah 2>errors).
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: polishing up a json fetching script for weather data
by Aldebaran (Curate) on May 21, 2020 at 06:43 UTC | |
by haukex (Archbishop) on May 22, 2020 at 08:18 UTC | |
by Aldebaran (Curate) on May 23, 2020 at 08:20 UTC | |
by haukex (Archbishop) on May 23, 2020 at 08:23 UTC |