in reply to Returning hash from sub

I have the same comment as everyone else, but I suspect from the error message that you are doing something different than they are guessing. Specifically I would guess that you are actually returning a reference to a hash, and you are trying to assign that to a hash. The reference is a single element, and will generate the error that you describe.

Your ease in moving to references is consistent with your accidentally returning a reference in the first place.

Replies are listed 'Best First'.
Re: Re: Returning hash from sub
by duff (Parson) on Dec 06, 2003 at 17:43 UTC

    Nah, that gives a different message. Something like "reference found where even-sized list expected". But until we see the code, we can only guess what's actually happening :-)