Re: slightly unexpected JSON roundtrip for arrays

2017-05-31 Thread Lloyd Fournier
It is the expected behaviour. The problem isn't what from-json is returning but what kind of assignment you're doing to the result. Here's a simple version: my @a = $[1,2,3]; say @a # [[1 2 3]] Since from-json doesn't know what it's returning, (a string, a hash, an array) it returns whatever it

slightly unexpected JSON roundtrip for arrays

2017-05-31 Thread Gabor Szabo
When converting an array to json and then back again, I need to use | or () in order to get back the original array in a @variable. This surprised me, especially as for hashes the roundtrip worked without any extra work. I was wondering if this is really the expected behaviour? Gabor use v6; use