Re: [Catalyst] Cross-link: How do I turn Moose objects into JSON for use in Catalyst?

2010-08-04 Thread Tomas Doran
On 3 Aug 2010, at 17:31, Evan Carroll wrote: I've posted a question and a few possible fixes. Does anyone have anything to add here? How do you go about dumping Moose to JSON in Cat? I use MooseX::Storage, as per perigrin's comment on the stack overflow post. Cheers t0m

[Catalyst] Cross-link: How do I turn Moose objects into JSON for use in Catalyst?

2010-08-03 Thread Evan Carroll
I've posted a question and a few possible fixes. Does anyone have anything to add here? How do you go about dumping Moose to JSON in Cat? http://stackoverflow.com/questions/3391967/how-do-i-turn-moose-objects-into-json-for-use-in-catalyst -- Evan Carroll - m...@evancarroll.com System Lord of

Re: [Catalyst] Cross-link: How do I turn Moose objects into JSON for use in Catalyst?

2010-08-03 Thread Alex J. G. BurzyƄski
Hi, On 03/08/10 16:31, Evan Carroll wrote: I've posted a question and a few possible fixes. Does anyone have anything to add here? How do you go about dumping Moose to JSON in Cat? http://stackoverflow.com/questions/3391967/how-do-i-turn-moose-objects-into-json-for-use-in-catalyst

Re: [Catalyst] Cross-link: How do I turn Moose objects into JSON for use in Catalyst?

2010-08-03 Thread Evan Carroll
The documentation  isn't clear on how, but this implies some combination of these flags (probably setting both to true) should do the encoding the reference as if it weren't blessed thing. No, allow_blessed(1) means it will not die, it will instead print out the totally useless string 'null'.

Re: [Catalyst] Cross-link: How do I turn Moose objects into JSON for use in Catalyst?

2010-08-03 Thread Evan Carroll
On Tue, Aug 3, 2010 at 12:34 PM, Stuart Watt sw...@infobal.com wrote: You're right - I just checked the sources and there is no valid code for this case, despite the implication of the documentation. I'd be tempted to file a bug against JSON::XS, as at least the pod is wrong. I guess it got

Re: [Catalyst] Cross-link: How do I turn Moose objects into JSON for use in Catalyst?

2010-08-03 Thread Evan Carroll
It also appears as if YAML::Syck does this very well: perl -MJSON::Syck -MURI -E'say JSON::Syck::Dump( bless { foo = URI-new(http://www.evancarrol.com;) } )' -- Evan Carroll - m...@evancarroll.com System Lord of the Internets web: http://www.evancarroll.com ph: 281.901.0011