in reply to Re: Print hash value even if it's zero
in thread Print hash value even if it's zero

You can also try

print 0 + $val;