system ("cat $file | jq '[.paths.get]' >7.txt");
I very strongly recommend against doing it this way, for several reasons: First, you're using the shell's features, namely piping a file into jq when that's not necessary - jq filter files works just as well. Second, you're using the single-argument form of system, and interpolating a variable into that, opening yourself up to all sorts of possible issues; I describe that and several better alternatives here, in this case I might suggest capturex from IPC::System::Simple. Third, calling an external command in the first place - everything that jq can do, you can do just as well in Perl, by parsing the JSON file into a Perl data structure and then working with that data structure.
In reply to Re^3: polishing up a json fetching script for weather data
by haukex
in thread polishing up a json fetching script for weather data
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |