Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个问题可能看起来很愚蠢,但我一直在这个问题上花费数小时。我不是 perl 专家。所以我有一个 JSON 编码的字符串,我用这个解码:
$filters = decode_json $data; $criteria = @{shift($filters)}{'criteria'};
然后我处理这些过滤器和标准,我想以 json 格式返回 $data。所以我很想把上面的代码颠倒过来。任何帮助,将不胜感激。
难道不只是
$data = encode_json $filters;
?