Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 69620
Status: resolved
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: LGODDARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.52
Fixed in: (no value)



Subject: convert_blessed_universally and max_depth problem

Message body is not shown because it is too large.

Subject: temp.pl

Message body is not shown because it is too large.

Sorry for late reply. I tried temp.pl and confirmed that it works. Can you give me more information in detail? Regards,
Unsure about the max_depth problem, but it appears there is a more general problem with convert_blessed_universally... which is that is doesn't work. Here is the test code (put it in a test.pl or similar): package ME; use strict; use warnings; package main; use strict; use warnings; use utf8; use JSON -convert_blessed_universally; my $x = bless { a => 1, b => 2 }, 'ME'; to_json( $x ) ; This fails with the error message: encountered object 'ME=HASH(0x1d7adf0)', but neither allow_blessed nor convert_blessed settings are enabled at /usr/share/perl5/JSON.pm line 140 [v2.15 but applies to latest version too.] In short, there are some global variables related to CBU which are being referenced.
On 2011-11月-09 水 22:46:27, MATHEW wrote: Show quoted text
> Unsure about the max_depth problem, but it appears there is a more > general problem with convert_blessed_universally... which is that is > doesn't work.
Show quoted text
> use JSON -convert_blessed_universally; > > my $x = bless { a => 1, b => 2 }, 'ME'; > > to_json( $x ) ; > > > This fails with the error message: > > encountered object 'ME=HASH(0x1d7adf0)', but neither allow_blessed nor > convert_blessed settings are enabled at /usr/share/perl5/JSON.pm line > 140
This is not a bug. You msut write the code: to_json( $x, { allow_blessed => 1, convert_blessed => 1 } ) ; Regards,
On Thu Nov 10 16:04:19 2011, MAKAMAKA wrote: Show quoted text
> On 2011-11月-09 水 22:46:27, MATHEW wrote:
> > Unsure about the max_depth problem, but it appears there is a more > > general problem with convert_blessed_universally... which is that is > > doesn't work.
>
> > use JSON -convert_blessed_universally; > > > > my $x = bless { a => 1, b => 2 }, 'ME'; > > > > to_json( $x ) ; > > > > > > This fails with the error message: > > > > encountered object 'ME=HASH(0x1d7adf0)', but neither allow_blessed nor > > convert_blessed settings are enabled at /usr/share/perl5/JSON.pm line > > 140
> > This is not a bug. You msut write the code: > > to_json( $x, { allow_blessed => 1, convert_blessed => 1 } ) ; > > Regards,
Closed as resolved.