in reply to explicit package name

When you use my in a block, that variable only exists inside the code block and disappears when you exit it. In the case of your @allanswers and @allquestion variables, you try to use these outside the codeblocks they're mean for. When you define something locally, you only override it's value for the extent of the block, and it reverts back to the original value after it. Thus, all your my and local definitions fail to exist after the code blocks they are in.

What you probably want to do is to do:

my (@allquestions, @allanswers);
before your while (<FILE>) loop; you can then remove any local or my declarations inside that loop.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important