in reply to Can't use string ("STRING") as a HASH ref - Help!

It is hard to say ... what are you passing to foo? What line is the error occuring? You might need to provide a little more info. But my WAG is that you are calling foo like so ...
foo($bar);
... when you should be calling it like this ...
foo(\$bar);

Plankton: 1% Evil, 99% Hot Gas.