$new_hash{$file{data}} = { extrct() }; # or if extrct returns a hash reference $new_hash{$file{data}} = extrct();