On the server side do I have 2 hashes I encode into JSON strings like so
my $j = JSON->new; $j = $j->utf8; my $data; $data->{users} = $j->encode(\\
you can use for in statement
var index = 0; for(user in users){ result += '' + index + '' + user['fn'] + '\n'; index++; }