It may be that the reference to the fetchrow_hashref is somehow losing scope outside the subroutine. I tried by faking your data in and it worked fine.

as for sugestions, I would just do

$href->{$ct} = $tmp_href; #rather than $results{$ct} = $tmp_href;
that way you don't need to waste time and memory on a copy of the hash

                - Ant
                - Some of my best work - (1 2 3)


In reply to Re: Preserving hash structure after subroutine call by suaveant
in thread Preserving hash structure after subroutine call by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":