in reply to Why is this a symbolic reference?

You're missing a $. Your code should look like this:
print keys %{ $hash_ref -> { key } };
The symbolic reference error comes from your code trying to dereference a string:
hash_ref->{key}
hash_ref isn't a hash ref, it's a string. $hash_ref is the hash ref.