Perl Create Json Array In Javascript Functions