With double quotes
The following command
$ cat ./multi_meta | jq .Partitions[].DocCount | perl -lne "$x += $_; END{ print $x;}"
gives me a syntax error:
syntax error at -e line 1, near "+="
Execution of -e aborted due to compilation errors.
With single quotes
I get the correct result with
$ cat ./multi_meta | jq .Partitions[].DocCount | perl -lne '$x += $_; END{ print $x;}'
Why?