in reply to Why is 'require' not working as I expect?

The function can't be found because it becomes loaded into the namespace of either module A or module B, depending on a fact you as yet haven't revealed, this being whether:

a) module A uses module B before it does the require (in this case the function becomes loaded into B's namespace) or

b) module A requires the file before using module B (and in this case the function becomes loaded into A's namespace).

-M

Free your mind

  • Comment on Re: Why is 'require' not working as I expect?