in reply to need help in validating json

#!perl use strict; use JSON; use Data::Dump 'pp'; my $obj = json(20); pp $obj; print "\n"; my $data_structure = from_json($obj); pp $data_structure ; sub json { my $n = shift; my @ar=(); for my $i (1..$n){ my $record = { 'id' => "stu_$i", 'is Active' => 'true', 'name' => "studentname$i", 'address' => 'getaddr', 'qualifications' => 'getqualifications', 'age' => 20+int rand(20), 'gender' => 'male', 'email' => 'getemail', 'about' => 'getabout', 'rgistered' => scalar localtime(), 'phone ' => 'getphone', 'standctry' => 'getstandctry', 'subjects' => 'getsubjects', 'subjects2' => 'getsubjects', }; push @ar,$record; } return to_json(\@ar); }
poj

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.