$gra{$k} is a reference, not a hash. Enclose it in %{...} like %{$gra{$k}}.
In reply to Re: Two-dimensional hash problem by diotalevi in thread Two-dimensional hash problem by nyk