Do you know where your variables are? | |
PerlMonks |
Re: make duplicate JSON keys an errorby vsespb (Chaplain) |
on Oct 24, 2013 at 17:22 UTC ( [id://1059521]=note: print w/replies, xml ) | Need Help?? |
You could try to write code (perhaps, a single regexp) which will prepend prefix to all keys in JSON string
You don't even have to check if this string is a key (it's ok to damage values) next, parse with JSON module, and when you find "1_op" and "4_op" in same hash - that would mean error. UPD: Alpha version: prints UPD2: You can even avoid double-parsing, just remove prepended numbers in filter_json_object and return correct data. In the end yo'll get correct hash on first pass.
In Section
Seekers of Perl Wisdom
|
|