in reply to Build JSON With Perl

Actually, that's not the hash reference itself that you're seeing. It's the third element of the hash, which was created by the empty curly braces. Change:

my %hash = {};

to:

my %hash;

and it should work the way you're looking for.

Replies are listed 'Best First'.
Re^2: Build JSON With Perl
by Tux (Canon) on Nov 11, 2011 at 07:20 UTC

    Using strict and warnings would have shown that:

    Reference found where even-sized list expected at -e line 1.

    Good catch though, I missed it in converting the example to a one-liner


    Enjoy, Have FUN! H.Merijn