This output is now stored..so, using this you can get the key output A B C..so, assign some value for the key if you stored values in hash $VAR1 = { 'A' => { 'B' => { 'C' => 1 } } };