in reply to Re^3: loading modules at runtime
in thread loading modules at runtime

But the import routine might also do other things than setting up symbols in the calling namespace - it might set up internal data corresponding to the namespace. So it doesn't hurt to call import, or at least to read the documentation of the imported module to see what it actually does.

Replies are listed 'Best First'.
Re^5: loading modules at runtime
by ikegami (Patriarch) on Oct 15, 2006 at 01:13 UTC

    use Module (); is the documented way of not importing symbols into your namespace. use Module (); does not call import.

    Furthermore, there is no stated requirement for all packages that use a module to use it. I often do use Module (); { package PkgA; ... } { package PkgB; ... } { package PkgC; ... }. Notice import was not called from any of the 4 packages involved.

    A module should not rely on import being called. (Pragmas are another matter.)