<div dir="ltr"><div>Hi,</div><div><br></div><div>read the doc here, please.</div><div><br></div><div><a href="https://metacpan.org/pod/JSON#allow_blessed">https://metacpan.org/pod/JSON#allow_blessed</a><br></div><div><br></div><div>you need implement TO_JSON method to your object.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 10:33 AM, Zahir Lalani <span dir="ltr"><<a href="mailto:ZahirLalani@oliver-marketing.com" target="_blank">ZahirLalani@oliver-marketing.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Hi<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In order work around the routing issue I posted earlier, I am trying to serialise the output but I get nulls.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The dump of the output structure is:<u></u><u></u></p>
<p class="MsoNormal">$VAR1 = [<u></u><u></u></p>
<p class="MsoNormal"> bless( {<u></u><u></u></p>
<p class="MsoNormal"> 'org_name' => 'Fashion',<u></u><u></u></p>
<p class="MsoNormal"> 'id' => 3<u></u><u></u></p>
<p class="MsoNormal"> }, 'org_list_dom' ),<u></u><u></u></p>
<p class="MsoNormal"> bless( {<u></u><u></u></p>
<p class="MsoNormal"> 'org_name' => 'Market',<u></u><u></u></p>
<p class="MsoNormal"> 'id' => 4<u></u><u></u></p>
<p class="MsoNormal"> }, 'org_list_dom' ),<u></u><u></u></p>
<p class="MsoNormal"> bless( {<u></u><u></u></p>
<p class="MsoNormal"> 'org_name' => 'Property',<u></u><u></u></p>
<p class="MsoNormal"> 'id' => 5<u></u><u></u></p>
<p class="MsoNormal"> }, 'org_list_dom' ),<u></u><u></u></p>
<p class="MsoNormal"> bless( {<u></u><u></u></p>
<p class="MsoNormal"> 'org_name' => 'Misc',<u></u><u></u></p>
<p class="MsoNormal"> 'id' => 6<u></u><u></u></p>
<p class="MsoNormal"> }, 'org_list_dom' )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Passing this ($res) into serialize:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> my $json = to_json( $res, { allow_blessed => 1, convert_blessed => 1 } );<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">gives<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">[null,null,null,null]<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any clues as to what I may be doing wrong?<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="HOEnZb"><font color="#888888">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Z<u></u><u></u></p>
</font></span></div>
</div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>