Oops, I think I accidentally removed that closing curly brace for the loop there. I originally posted the without using any HTML tags and went back to adjust the post manually... got a little too carried away.
You are probably right, spawning new processes is always expensive, and making this only once shows that Perl runs much faster. I would like to play with hyperfine as suggested above, so I might try that when I have something a bit more meaningful to test on.
The "benchmark" was just for fun, thought, to see how Python and Perl compare. What I'm more concerned is with the correctness of the script, specifically how the JSON is processed. As I said, I find this syntax a bit strange: (@$decoded). I couldn't figure it out without looking for answers online and I'm not sure if there's perhaps a better way to tell Perl that this is an array (assuming that I know in advance the structure of the JSON to be returned)?
In reply to Re^2: Adjusting variable context when working with JSON data?
by unmatched
in thread Adjusting variable context when workign with JSON data?
by unmatched
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |