in reply to need help in validating json

..., i am getting the errors i could not find where the error occurs,please help me ...

Sure, here you go Basic debugging checklist , brian's Guide to Solving Any Perl Problem, On debugging, verify everything, talk to teddybear ... checklists and more ..

Before you try to generate $n=20 worth of valid json, try to generate $n=1 worth of valid json