I apologize if my title is confusing. I'll try to explain.
I'm taking over for someone who left my company abruptly and have little experience with Perl programming. My O'Reilly books, Google, and searches here have led me into an increasingly confusing spiral and I'm at a dead end.
I have an auto-generated hash which is periodically updated and saved on a server as a text file. The file contents are as such:
$VAR1 = {
'qa_metrics' => {
'group_level' => {
},
'product_level' => {
'qa_metric_1' => [
{
'operator' => '>',
'limit' => '5',
}
],
'qa_metric_2' => [
{
'operator' => '>',
'limit' => '5',
}
]
}
}
'speed_metrics' => {
'group_level' => {
'group_speed_metric_1' => [
{
'operator' => '>=',
'limit' => '6',
}
]
},
'product_level' => {
'speed_metric_1' => [
{
'operator' => '>=',
'limit' => '6',
}
],
'speed_metric_2' => [
{
'operator' => '<=',
'limit' => '13',
}
]
}
}
'other_metrics' => {
'product_level' => {
'other_metric_1' => [
{
'operator' => '==',
'limit' => '1',
}
],
'other_metric_2' => [
{
'operator' => '<',
'limit' => '3',
}
]
}
}
}
The project I'm working on requires that I walk through the multi-level hash structure and push all of the 'product_level' metric names into an array based on metric type. For example, qa_metric_1
, qa_metric_2
, and any others of that type (qa
) and level (product
) would be pushed into one array while speed_metric_1
, speed_metric_2
, and other_metric_1
, other_metric_2
, etc would be pushed into their own separate arrays.
Once the arrays are populated and contained in ,
, and ``, or similar, I believe I can proceed from that point on my own.
I should mention that I am working with Perl 5.8 and my ability (meaning permission from IT) to add 3rd-party modules is almost nonexistent.
Any help would be much appreciated.