in reply to Destructors and global variables

I have two .pl files which share two array variables.

Variables don't exists in files, .pl or otherwise. Please explain what you mean.

Are you asking if code from two files can use the same variable? yes.

That said, I can't figure out why would a program use two .pl files.

Does perl behave in the same way as C++, when it comes to destructors?

What are you asking about specifically?