JavaScript::Dumper - Dump JavaScript data structures from Perl objects. Allows unquoted strings and numbers.
use JavaScript::Dumper; my $js = js_dumper([{foo => "bar", number => 12345, boolean => \1, call => \"function"}]); # results in: # $js = "[{"foo": "bar", "number" => 12345, "boolean" => true, "call": function}]";
This module uses JSON::PP as base and overrides value_to_json to accept SCALAR-refs to be returned without quotes.
value_to_json
Dumps any perl data structure.
\'1' becomes "true" \'0' becomes "false"
See JSON::PP or JSON::XS for more details.
Returns JavaScript::Dumper object.
For all other methods see JSON::PP and JSON::XS.
JavaScript::Dumper is as slow as JSON::PP. You might want to cache the output or use it only for small objects.
Find someone who does a speedy version of this module
JSON::PP, JSON::XS
Moritz Onken (perler)
Copyright 2007 by Moritz Onken
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install JavaScript::Dumper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JavaScript::Dumper
CPAN shell
perl -MCPAN -e shell install JavaScript::Dumper
For more information on module installation, please visit the detailed CPAN module installation guide.