in reply to Checking JSON decoded params from Dancer

decode_json is a function. It returns the data structure and does not modify its argument in place. You might want:

my $foo; my $ok= eval { $foo= decode_json( $foo_info ); 1; }; if( ! $ok ) { my $err= $@; flash error => "Failed"; warn "JSON Decoder got '$err'"; }; # Now we have the decoded data structure in $foo warn Dumper $foo;

Replies are listed 'Best First'.
Re^2: Checking JSON decoded params from Dancer
by PerlSufi (Friar) on Jul 11, 2014 at 17:39 UTC
    Thanks Corion- good to know. I am still trying to figure out how to correctly parse the data to see if I have the correct field and value in the json..