I'm using Class::Struct, and I created a struct that has a hash inside it. Now I want to loop through all of the elements in the hash using a foreach loop. The code looks like this..
foreach ( keys $games{$curGame}->matrix )
{
# stuff happens here...
}
%games is a hash of structs, and matrix is a hash within the struct that I'm trying to loop through. You can see how I'm trying to loop through it, but keys() apparently won't take that as an argument. So I'm wondering, how do I loop through its elements? (Also, kind of a side question.. is there a different way to do structs in perl? I really don't like Class::Struct)
foreach ( keys $games{$curGame}->matrix )
{
# stuff happens here...
}
%games is a hash of structs, and matrix is a hash within the struct that I'm trying to loop through. You can see how I'm trying to loop through it, but keys() apparently won't take that as an argument. So I'm wondering, how do I loop through its elements? (Also, kind of a side question.. is there a different way to do structs in perl? I really don't like Class::Struct)