in reply to require function not passing lexical variable

As Fletch said, the documentation says that it does not. But he didn't explain why it does not.

The reason why is that require means "make sure that this code has been run", and not "insert this code here". The same file can be required in many places, but will only be run once, in a scope of its own.

  • Comment on Re: require function not passing lexical variable