in reply to Returning hash from sub

Like duff says, we're going to need to see the code. The same code should yield the same results. There may be subtle differences outside of the code you cut and pasted, though, like what $/ is set to, how the subroutine closes, etc.

For what it's worth, here's how I ended up getting around the hash-in-scalar-context problem with reading in Data::Dumper files:

sub parse_hist { local $/ = undef; %sess_hist = %{do($hist_file)}; }

In this case, %sess_hist is the last thing in the subroutine, so that should be what is returned. In my code, parse_hist was called in void context and %sess_hist was a global variable, so it didn't matter how stuff got returned (except that I'm probably wasting memory and cycles).