use strict; use warnings; my $hashref = { normal_enemies => { cloud_guy => { attacktype => 'thunder', power => 4, hp => 5, }, rain_man => { attacktype => 'water', power => 3, hp => 7, }, flame_kid => { attacktype => 'fire', power => 6, hp => 4, }, }, boss_enemies => { large_shark => { attacktype => 'water'. power => 9, hp => 13, special => 'none', }, wingding_monster => { attacktype => 'font'. power => 24, hp => 23, special => 'encrypt', }, green_dragon => { attacktype => 'fire'. power => 8, hp => 58, special => 'fire breath', }, }, items => { weapons => { sword_chucks => { power => 28, accuracy => 6, recommended_class => 'Crazy Fighter', }, cane => { power => 7, accuracy => 3, recommended_class => 'The Mage That Just Uses Magic. You know, if he ever needs to use this thing you\'re screwed anyway, right?', }, katana => { power => 'over nine-thousand', accuracy => 8, recommended_class => 'Ninja Assassin', }, }, armor => { helm => { body_part => 'head', defense => 2.5, }, guantlets => { body_part => 'hands', defense => 1, }, necklace => { body_part => 'neck', defense => .1337, }, }, }, }; my %hash = %$hashref; print "Normal(Should fail with 'HASH(0xhex)' - $hashref\n"; print "Dereferenced - \n"; foreach (keys %hash) { print "$_ - $hash{$_}\n"; }