David E. Wheeler
2009-10-07 04:27:13 UTC
Howdy,
Other than the ability to set "package variables" in aliases, I've
found one other difference between aliases and imported templates: The
invocant.
In imported templates, the invocant is an object blessed into the
class into which the templates were imported.
In aliased templates, the invocant is an object blessed into the class
from which the templates were aliased.
Is this an important distinction? The tests in t/aliasing.t and t/
importing.t demonstrate it quite clearly, but I'm wondering whether
anyone ever noticed this or if it's necessary? To me, the behavior of
aliases is a bit weird, since they're supposed to be like mixins.
Thanks,
David
Other than the ability to set "package variables" in aliases, I've
found one other difference between aliases and imported templates: The
invocant.
In imported templates, the invocant is an object blessed into the
class into which the templates were imported.
In aliased templates, the invocant is an object blessed into the class
from which the templates were aliased.
Is this an important distinction? The tests in t/aliasing.t and t/
importing.t demonstrate it quite clearly, but I'm wondering whether
anyone ever noticed this or if it's necessary? To me, the behavior of
aliases is a bit weird, since they're supposed to be like mixins.
Thanks,
David