On Tue, 26 Dec 2000, Ken Williams wrote:

> [EMAIL PROTECTED] (Stas Bekman) wrote:
> >A combination of C<strict> and C<vars> pragmas keeps modules clean and
> >reduces a bit of noise.  However, the C<vars> pragma also creates
> >aliases, as does C<Exporter>, which eat up more memory.  When
> >possible, try to use fully qualified names instead of C<use vars>.
> 
> I have to disagree with this benchmark.  The aliases take up only the
> tiniest bit of memory, much less than your benchmark seems to indicate. 

they can add up quick:
% perlbloat 'use POSIX ()'
use POSIX () added  316k

% perlbloat 'use POSIX'
use POSIX added  696k

that's 380k worth of aliases.  now let's say 6 different registry scripts
'use POSIX;' for strftime or whatever, 6 * 380k = 2.3Mb

they could save 2.3Mb with 'use POSIX ();' and fully qualifying POSIX::
function calls.

so a few 'use vars ()' here and there doesn't eat that much, your call.

Reply via email to