Omg, you're right, that solved it. I feel a bit ashamed now - especially since that was my first question here.
For future reference: using 'our' works, only problem with the code was that I was too stupid to use an assoc array in Perl. :(
Btw: Do I now have a reputation of -1 because my question sucked or simply because I asked 1 question and answered 0 so far (and 0 - 1 = -1)?