[jifty-devel] RFC: Design change in ClassLoader

Alex Vandiver alexmv at bestpractical.com
Thu Jun 22 15:31:55 EDT 2006

On Thu, 2006-06-22 at 15:19 -0400, John Peacock wrote:
> However, when Jifty does the same thing for MyWeblog::Model::Post (which 
> is a model class that I created in MyWeblog directly), #2 fires then 
> returns undef (errors out) trying to provide support for 
> Jifty::Plugin::Login::Model::Post (which doesn't exist).  #3 then fires 
> and correctly handles all of the classes for MyWeblog::Model::Post out 
> of Jifty's own classes.

Hrm.  But returning 'undef' from the INC sub should silently pass
control on to the next thing in @INC.  perlfunc says:
        If an empty list, C<undef>, or nothing that matches the first 3
        values above is returned then C<require> will look at the
        remaining elements of @INC.

That being said, I think it's probably easier to understand the
ClassLoader if it only shows up once in @INC, so the fall-though isn't
implicit but explicit, so having a loop that processes regexen would be
a much cleaner alternative to the current code.
 - Alex

More information about the jifty-devel mailing list