|
| Hi,
I am fairly new to perl and not loving the syntax! Basically what i
have is a set of options, S1,S2,S3, which should return a list of a
list of data items: So:
First of all I got this working:
%res = (
A =>
{
A =>
{
A => "AAA",
B => "AAB"
}
}
B =>
{
A =>
{
A => "BAA",
B => "BAB"
}
}
)
and so forth and I can access the strings with:
print ("$res{"B"}{"A"}{"B"}");
but if i change the leaf nodes as:
%res = (
A =>
{
A =>
{
A => ["AAA", "optAAA"],
B => ["AAB", "optAAB"]
}
}
B =>
{
A =>
{
A => ["BAA", "optBAA"],
B => ["BAB", "optBAB"]
}
}
)
and now i want to iterate over the items in the list, I can't work out
how to do it!! I have spent the last 2 day with foreach loops and a
variety of $%@ variable prefixes tearning my hair out!
by the end i want something as:
%res = (
A =>
{
A =>
{
A => [
["AAA_1", ["optAAA_1_1, optAAA_1_2"]],
["AAA_2", ["optAAA_2_1, optAAA_2_2"]],
["AAA_3", ["optAAA_3_1, optAAA_3_2"]],
]
}
}
)
so that I can iterate over the "AAA_1", "AAA_2" in order that they are
given and perform operations on thier "opt" counterparts
I would be exceptionally gratefull for any help, especially if its
explained and simply!!
Regards
Mike
|
|