Ok, so I've got a method that returns a hash like this:
return %{$obj->{$attr_name}};
And when I want to access this hash I can do this:
my %hash = $obj->method();
Splendid.
So why can't I be Lazy and do this?
foreach my $item (keys %{$obj->method()} {
My guess is that the hash gets flattened into list context by the return and somehow doesn't get coerced back into a hash by the keys function, whereas explicitly assigning it to a hash does coerce it. Anyone care to enlighten me?