> His rationale for not exporting symbols is because it 'eats up a lot of
> memory'.

  Then it's a false rationale. When you export globs[0] it's only a
shallow copy - so the new glob is created in the symbol table, but all the
glob slots remain in the same location e.g

  shell> perl -l -
  $foo::bar = "a string";

  *bar = *foo::bar;

  print $bar;
  $foo::bar = "a new string";
  print $bar;

  print \$foo::bar;
  print \$bar;

  __output__

  a string
  a new string
  SCALAR(0x1012f6cc)
  SCALAR(0x1012f6cc)

So as you can guess this just isn't memory hungry, so the reasoning for
not exporting globs shouldn't be because of the memory. Now namespace
pollution is another thing, but I reckon if your subs are relatively
unique then it's not much of an issue, but then again it's not much of an
issue to fully qualify the subs (assuming they're in their own namespace).

  Cheers,
Dan

[0] which is how symbols are often referred to as

Reply via email to