[MTOS-dev] Circular reference issue
Timothy Appnel
tim at appnel.com
Tue Jan 15 12:08:18 PST 2008
Nice work Hirotaka! Well done.
Just a couple of things I learned from working out the problems I
created in XML::Elemental:
There are apparently some issues with weaken and how some people
install Perl. From the Task::Weaken docs:
> One recurring problem in modules that use Scalar::Util's weaken function is that it is not present in the pure-perl variant.
>
> While this isn't necesarily always a problem in a straight CPAN-based Perl environment, some operating system distributions only include the pure-Perl versions, don't include the XS version, and so weaken is then "missing" from the platform, despite passing a dependency on Scalar::Util successfully.
>
> Most notably this is RedHat Linux at time of writing, but other come and go and do the same thing, hence "recurring problem".
There doesn't seem to be a better alternative to weaken. I'm just
pointing this out for future reference in supporting MT installations.
Perhaps this will be helpful to those creating distributions of MTOS
also.
The other is just coding style with the use of weaken. Lines like these:
+ $node->[5] = shift;
+ weaken($node->[5]);
...can be condensed into one:
+ weaken($node->[5] = shift);
It makes for less typing and tighter code. I did it in two lines also
until it was pointed out to me.
The template object stash is such a new thing that I think the
potential impact of breaking compatibility should be minimal if
anything at all. I'm having a hard time thinking of how you would end
up with the context object after building and not have a reference to
the template object.
I'm still suspicious of how many individual MT::Object implementations
stash references to each other that I have to wonder of circular
references are being created in there.
<tim/>
--
Timothy Appnel
Appnel Solutions
http://appnel.com/
More information about the MTOS-dev
mailing list