As NetWallah mentioned, your hash dereference syntax is subtly wrong. The dereference operators bind very tightly, and also accept a BLOCK that evaluates to a reference. Where you have %$self->{simple_hash}, you should instead write %{$self->{simple_hash}}. The full details are in perlref. The warning about using a hash as a reference is produced when perl interprets %$self->{simple_hash} as %{$self}->{simple_hash}. The object you are using is stored as a hashref, so %{$self} evaluates to the object itself, rather than an instance variable.
Other monks have also mentioned that your test code does not correctly produce a hash reference. See perlreftut and perldsc for more information.
In reply to Re: Trouble passing a hash to a module
by jcb
in thread Trouble passing a hash to a module
by mcrepeau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |