in reply to Returning hash from sub
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).
|
|---|