in reply to Re: Passing hashes to sub
in thread Passing hashes to sub

As mentioned by huck, you need to pass references to your hashes to the subroutine to avoid list flattening (and most probably to dereference them within the subroutine, depending on your needs.

May be this was just for your testing and debugging purposes, but I would add that since your subroutine always returns 1, the $ComResult will always end up being assigned to 1, which probably does not make too much sense (except, as noted if this was only for testing purposes). My only point here is that if your subroutine is supposed to return two new hashes (or arrays), then you would also need to use references to them in order to avoid list flattening on the return values.