in reply to reference question

Change
print $where->{$_};
to
print $where{$_};
$where is not a hash reference, it's a plain hash.