Several monks have already told you that your only error is trying to use the symbol $Records as both a hash and a hash reference. This is an easy mistake to make it is one of the reasons why we tell everyone to ALWAYS use 'use strict'. Perl would tell you that one of them is a Global Symbol and requires an explicit package name. When you are given the offending line number and variable name, you should be able to figure it out yourself.