If module A depends on module B (uses methods or subroutines from module 
B), is there a good way to test that module A loads module B (i.e. has a 
"use" statement)?  I frequently run into the following scenario:

1. Write one or more new modules plus a handler that uses them.
2. One or more of those modules is dependent on other existing modules.
3. One of those modules is missing a "use" statement for one of the 
existing modules that it makes method/sub calls to.
4. The handler works in the development environment because some other 
handler loaded that module previously in response to a previous http 
request. (The brunt of the handler code is "require"-ed on demand currently).
5. Promote code from development server to production server.
6. Restart apache on production server.
7. Handler fails on production server in response to an access that 
exercises the section of code where the missing "use" was needed 
(i.e.subroutine or method call to module that wasn't loaded).

--
Matthew Pressly

Reply via email to