in reply to Is require still required?
I can think of a lot of examples of where a module should be required, at runtime, rather than used at compiletime. Factory method patterns, providing implementation of functionality into code based on some logic, only needing to load a module if a specific condition is met, dependency injection, and so on. And there are times that filenames versus bareword module names are useful. If you search CPAN for the word 'require' you'll find a ton of use cases you probably haven't considered, and while many of them don't HAVE to be coded the way they were, many of them used require because it was the appropriate tool for the job.
Dave
|
---|