in reply to Re^2: JSON.pm returning "false" instead of false
in thread JSON.pm returning "false" instead of false

I'm pretty sure I'm calling the serialize function but I'll have to trace it through.

I meant in the code you provided. In other words, you didn't demonstrate a problem since the code you posted didn't do anything at all. My guesses as to what your code might be proved to be a waste of time since I could not reproduce the problem you describe.

Please provide minimal code that reproduces the problem. The code you posted works fine when I call it. I even tried replacing the use statement with the BEGIN block you more recently provided.

Replies are listed 'Best First'.
Re^4: JSON.pm returning "false" instead of false
by josh803316 (Beadle) on Apr 12, 2010 at 22:43 UTC
    It's a big app so I didn't want to bog anyone down with the details, although I should have provided a test case. Your answer actually brought me to the solution though. It turns out that the $self->render_json method from Mojo was not being over-ridden correctly, and was therefore never calling the "serialize" method just as you suggested. So, I thank you very much for giving me a hint and leading me down the correct path. Next time, I will provide a test case that demonstrates the issue a little more clearly.

      That's the point of making a minimal example.

      1. It is small enough to debug.
      2. It demonstrates the problem.

      When you do those steps, you often find the answer yourself. If not, you'll know what to look at in the simple examples for next time.

      Thanks for all your feedback, sadly I know this already I was just being lazy. Ishould have taken the time to create a complete working test example and in doing so I would have found the problem. I completely agree that creating a base case makes it much easier for people to comment on and often allows me to find the solution myself before asking anyone. Thanks again for all the feedback.