I have a large amount of data saved as a Data::Dumper output.
How in the world am I suppose to read this data? I would like to reorganize it but I'm completely lost to the approach. the data structures are hashes in arrays that are hashes of hashes...
Here is a (very trimmed down) example. Also the creation wasn't great as a character can have two "attacks" or two "specials" so obviously it's a collision and one will be overwritten.
EDIT: What I'm really asking is this: Is this an ideal way to store data like this? or is there a better way? because to me accessing the hash like $char_hash{Character Name}{abilities}{attack}{tiers}{level 1}{description}
seems terrible to write. and iterating through things like @{$char_hash{Character Name}{Equipment}{Equipment Level 1}{Items}}
seems crazy difficult
my @char_hash = (
"Character Name" => {
"description" => "",
"alignment" => "",
"categories" => [
"ex 1",
"ex 2",
"ex 4",
"ex 5"
],
"primaryStat" => "Strength (STR)",
"baseStats" => {
"Strength (STR)" => "22",
"Agility (AGI)" => "15",
"Intelligence (INT)" => "17",
"Speed" => "100",
"Health" => "197",
"Physical Damage" => "17"
},
"abilities" => {
"attack" => {
"name" => "ex 1",
"type" => "Physical",
"tiers" => {
"level 1" => {
"description" => ""
},
"level 2" => {
"unlockLevel" => 16,
"cost" => {
"Money" => 700,
"Material" => 3
},
"fromPrevious" => "+5% Damage",
"description" => ""
}
},
"conditions" => {
}
},
"special" => {
"name" => "ex",
"cooldown" => 3,
"type" => "special",
"tiers" => {
"level 1" => {
"description" => ""
},
"level 2" => {
"unlockLevel" => 18,
"cost" => {
"Money" => 1300,
"Material" => 2
},
"fromPrevious" => "+5% Damage",
"description" => ""
}
},
"conditions" => {
}
},
"Equipment" => {
"Equipment Lvl I" => {
"cummulatedStats" => {
"Strength (STR)" => "+22",
"Agility (AGI)" => "+15",
"Intelligence (INT)" => "+17",
"Speed" => "+100",
"Health" => "+197",
"Physical Damage" => "+17"
},
"items" => [
{
"name" => "",
"id" => "",
"tier" => 1,
"mark" => "",
"requiredLevel" => 1,
"sellValue" => 10,
"stats" => {
"Physical Damage" => ""
}
},
{
"name" => "",
"id" => "",
"tier" => 1,
"mark" => "",
"requiredLevel" => 2,
"sellValue" => 20,
"stats" => {
"Strength (STR)" => "",
"Agility (AGI)" => "",
"Intelligence (INT)" => ""
}
},
{
"name" => "",
"id" => "",
"tier" => 1,
"mark" => "",
"requiredLevel" => 2,
"sellValue" => 20,
"stats" => {
"Strength (STR)" => "",
"Agility (AGI)" => "",
"Intelligence (INT)" => ""
}
},
{
"name" => "",
"id" => "",
"tier" => 1,
"mark" => "",
"requiredLevel" => 2,
"sellValue" => 20,
"stats" => {
"Speed" => ""
}
},
{
"name" => "",
"id" => "",
"tier" => 1,
"mark" => "",
"requiredLevel" => 2,
"sellValue" => 20,
"stats" => {
"Strength (STR)" => ""
}
},
{
"name" => "",
"id" => "",
"tier" => 1,
"mark" => "",
"requiredLevel" => 2,
"sellValue" => 20,
"stats" => {
"Armor" => ""
}
}
]
}
}
}
}
);