[jifty-devel] Classloader's loader
Jesse Vincent
jesse at bestpractical.com
Wed Oct 25 12:36:12 EDT 2006
On Oct 23, 2006, at 7:35 PM, John Peacock wrote:
> Gaal Yahas wrote:
>> Jifty::Everything (or probably in a new module required by it):
>>
>> # after 'use Module::Pluggable'
>>
>> # only needs to be done once, so can remove from
>> # Jifty::ClassLoader/Util
>> use UNIVERSAL::require;
>>
>> {
>> no strict 'refs';
>> no warnings 'redefine';
>> *{'Module::Pluggable::Object::_require'} = sub {
>> my($self, $pack) = @_;
>> UNIVERSAL->require($pack);
>> return $@;
>> };
>> }
>>
>> I don't like this very much because it feels Jengaish, so please
>> comment
>> if you have a better idea. It does work, anyhow.
>
> I think that the correct fix would be for Module::Pluggable to DTRT
> in the first
> place (i.e. it should call $self->SUPER::require() instead of
> CORE::require(),
> so that exactly this situation would be handled), though that may
> not be
> possible due to the twisty passages that M::P has to negotiate
> already.
>
> Alternatively, we could simply subclass Module::Pluggable and
> override its
> require() with the above sub(). This has the distinct advantage of
> not messing
> with the namespaces directly (but it is the moral equivalent).
>
Yep. And talking to Simon (Author of M::P), that's the recommended
path. Wanna give it a shot?
Date: October 24, 2006 12:19:31 AM PDT
From: simon at thegestalt.org
Subject: Re: Module::Pluggable and CORE::require
To: jesse at bestpractical.com
On Mon, Oct 23, 2006 at 09:11:22PM -0700, Jesse Vincent said:
> does this thread make any sense to you? It looks like
> Module::Pluggable is interacting poorly with UNIVERSAL::require?
>
Module::Pluggable used to to use UNIVERSAL::require but I switched
because I was trying to get rid of dependencies.
I farmed the requiring stuff off to it's own _require method in order to
make it easy to subclass so that people could ovveride how the require
was done.
Would changing it to be just
eval "require $pack";
help your cause?
Simon
> John
>
> --
> John Peacock
> Director of Information Research and Technology
> Rowman & Littlefield Publishing Group
> 4501 Forbes Blvd
> Suite H
> Lanham, MD 20706
> 301-459-3366 x.5010
> fax 301-429-5747
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20061025/99fb65d2/PGP.pgp
More information about the jifty-devel
mailing list