in reply to Trying to print the contents of a hash, but getting a reference.

Were you used warnings it could be much more easier for you to find reason for your problem.

With warnings turned on your program yeilds warning:

Reference found where even-sized list expected at ...
for line
c={A=>'0',B=>'0',C=>'0',D=>'0'};
And with use diagnostics you could get even more detailed explanation of problem:
Reference found where even-sized list expected (W misc) You gave a single reference where Perl was expecting a list with an even number of elements (for assignment to a hash). This usually means that you used the anon hash constructor when you meant to use parens. In any case, a hash requires key/value pairs. %hash = { one => 1, two => 2, }; # WRONG %hash = [ qw/ an anon array / ]; # WRONG %hash = ( one => 1, two => 2, ); # right %hash = qw( one 1 two 2 ); # also fine
So conclusion is: use strict warnings and diagnostics or die.