in reply to can't use string as hash ref

from memory what you get is a hashref to the hash holding the result of your query. hence first you need to dereference the initial hashref. so something like this during your fetch processing loop:
my $column1value = \$result_hash{'col1'};
note the back slash, dereferencing the hash reference. there are examples of fetch loop processing code using the fetchall_hashref on the web and in the documentation for DBI.
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^2: can't use string as hash ref
by chromatic (Archbishop) on Oct 25, 2010 at 19:37 UTC
    note the back slash, dereferencing the hash reference

    I don't understand what you're trying to say here, and I'm fairly certain this will only confuse other people. The backslash operator takes a reference. You might end up with a reference to a reference if the value in the hash associated with col1 is itself a reference.

    ... and that's not the OP's problem, anyway. The real problem is attempting to dereference something which is not a reference at all.