The problem in a nutshell
$ cat junk
use strict; use warnings;
use diagnostics;
my %where = ();
$where{something} = 4;
$where{something}{else} = 5;
__END__
$ perl junk
Can't use string ("4") as a HASH ref while "strict refs" in use at jun
+k line 5 (#1)
(F) Only hard references are allowed by "strict refs". Symbolic
references are disallowed. See perlref.
Uncaught exception from user code:
Can't use string ("4") as a HASH ref while "strict refs" in us
+e at junk line 5.
at junk line 5
Either $where{something} is a hashref or it isn't, it can't be both, so pick one
You can pick
#~ $where{$colname}=$colval;
$where{$colname}{colval} =$colval;
There are other problem, but I'll leave that to others