in reply to What are the advantages or disadvantages of "require" over "use"
G'day ghosh123,
In the use documentation, you'll see:
It is exactly equivalent to
BEGIN { require Module; Module->import( LIST ); }except that Module must be a bareword. The importation can be made conditional by using the if module.
So, if you had to use require, you could still get the compile time checks with:
BEGIN { require Module; }
However, reading a bit further down the use documentation, you'll see that this is exactly equivalent to
use Module ();
So, unless you're unable to specify a bareword for Module (see this post of mine from a few days ago for an example), or you have a particular need to load Module at runtime (e.g. your point #4 scenario [although see below]), there's really no reason not to use use.
Finally, regarding the points you made:
-- Ken
|
|---|