On Di. 14. Aug. 2007, 17:32:59, HOOO wrote:
Show quoted text> There is a memory leak in 'as'.
> Unloading as does not remove the module entry in the hash table used in
> 'as'.
>
> Cheers
> Ho
I beg your pardon, there is no memory leak. I tested it with:
package main;
use as;
eval "
use Tie::Scalar as => TieScalar$_;
use TieScalar$_ as => TieScalarXXX$_;
no TieScalar$_;
no TieScalarXXX$_;
"
foreach 1..1000000000;
__END__
Looking in the documentation, 'as' is designed to use in the package
where the 'use' statement occures, to directly renaming a module name
while importing. In difference to 'Package::Alias' which can be used in
the package itself so the package can provide an alias.
Thought i could write:
package Very::Long::Package::Name;
use as 'Bah';
This would be easier to read than:
package Very::Long::Package::Name;
use Package::Alias 'Bah' => __PACKAGE__;
What do you think about this syntax?
Cheers Ho.