|
|
| Do you know where your variables are? | |
| PerlMonks |
Javascript in your JSONby Anonymous Monk |
| on Apr 08, 2009 at 09:21 UTC ( #756287=perlquestion: print w/ replies, xml ) | Need Help?? |
|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
Hi there monks,
I'm looking for a module on CPAN that can convert Javascript code snippets to JSON, apart from also doing the more common data-structure to JSON conversion. I've tried JSON::XS, ::Syck, ::PP and neither seem to be able to do this: And the output should look like this:
But it usually converts it to: ...handler: "function(...)" I know I've seen something that can do that somewhere. I think the usual implementation would use scalar references (ie \"function(){ }") to achieve this. But none of the regular JSON modules seem to accept it. Any clues?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||