in reply to My globals are visable; but undef'ed

The real solution to your problem is to realize that communicating through global variables is a very bad idea. Instead you want to start to pass in parameters explicitly to the functions that need them so that you're documenting what is used where.

The reason is that calling sections of code "components" doesn't actually help you much unless the interfaces between those components are fairly minimal and well-defined. Communicating through random global variables results in complex and poorly defined interfaces.

Oh, and before you go too far in breaking this up you should really look at Exporter. The ability to import functions into a namespace can go a long way towards making this kind of refactoring a lot less painful to do.

  • Comment on Re: My globals are visable; but undef'ed