in reply to Re^6: Return value of Search::Elasticsearch search query
in thread Return value of Search::Elasticsearch search query

That is because you are assiging the same reference to \%main_hash in multiple places.

Maybe you want to create a reference to a fresh copy of %main_hash every time? The following code will create a fresh copy of the contents of %main_hash:

{ %main_hash }

I recommend that you trim down the amount of references you're diving around with until you understand references and data structures in general better.

Replies are listed 'Best First'.
Re^8: Return value of Search::Elasticsearch search query
by ravi45722 (Pilgrim) on Jul 13, 2016 at 07:09 UTC

    Thanks. Now I understand how the references working. As you suggested I started from 0 and finally acheived. Thanks for the reply.