in reply to Setting up a hash in a linear search through XML

The most immediate problem that jumps out is that you declare but never initialize %act (while you then go on to set your iteration variable $scene on the next line with presumably what you wanted in %act) and then you attempt to iterate over its contents.

The cake is a lie.
The cake is a lie.
The cake is a lie.