in reply to Re: modules and memory usage
in thread modules and memory usage

Somewhat of a nit: the many forms of AUTOLOADing end up saving memory when you fail to call most of the routines that a module provides. Importing the routine names takes up extremely little memory and doesn't trigger the AUTOLOADing of the routines.

So you could import hundreds of routines from a module that uses AUTOLOADing and see almost no increase in memory usage so long as you never actually called any of those routines. Conversely, you could import none of them and call lots of them (either directly or indirectly) and see a big increase.

I routine only import the routines that I use, but my reasons have nothing to do with memory consumption. A small part of it is that I'm against namespace pollution. A bigger part of it is that listing the routines that I use on the use line is a very handy form of documenting where you need to go to figure out what WhingeGromets() is doing when you see it later in the code. It is a nice form of functional documentation because if it gets out-of-date, it automatically tells you so (well, except that Perl never complains if you import a routine and then never use it).

        - tye (but my friends call me "Tye")