in reply to Re^6: Append JSON (from hashref)
in thread Append JSON (from hashref)

There is something you are not telling us, your example link shows a hash as the containing structure, yet your example json is a hash inside an array. Is this what you want?

my $tmp = $dbh->selectall_arrayref($query, { Slice => {} }, $SearchWor +d ); my $container={items=>$tmp->[0]}; $container->{inputPhrase}=$SearchWord; my $json_str = encode_json( $container );
Just what is it you expect to see returned?

Replies are listed 'Best First'.
Re^8: Append JSON (from hashref)
by Anonymous Monk on Apr 07, 2017 at 13:12 UTC
    changing one line of your code to
    my $container={items=>$tmp};
    worked, providing the structure needed. Thanks