in reply to Re^2: Outputting JSON with function () {...} values
in thread Outputting JSON with function () {...} values

> should be decodable as JSON

The OP didn't ask for real JSON but a nested JS data structure, which is an upper set.

This can't be decoded, Perl doesn't have a builtin JS parser (yet).

The only way I see is to serialize objects like this function as string - hence lethal JSON - and to have a conversion filter on the JS side before using it (here with eval)

Though I'm not sure about the best way to mark such objects to be distinguished from normal strings.

See also point 3

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re^3: Outputting JSON with function () {...} values