Re: Accessor to module

[email protected] (Stevan Little)
Newsgroups perl.moose
Message-ID <[email protected]>
Bianka,

On Jun 1, 2007, at 4:24 AM, Bianka Martinovic wrote:
>> Actually, it shouldn't be, it should only call the 'default' sub  
>> the first time the ->loader accessor is called. After that, it  
>> stores the newly create CM::Module::Loader instance.
>
> Well, to be more precise: It happens if a _submodule_ calls the  
> accessor (for the first time). I think Eric is right, it's by  
> design (and surely correct), I don't think it's a bug.

Yes, Eric is correct.

> I just wanted to hear if my solution is a proper way, or if I  
> missed something.

And actually, your solution with the package variable was fine,  
although I tend to agree with Eric that it would be better for that  
responsibility to be in the CM::Module::Loader's new method.

> By the way, I really like this module, though I'm afraid that I  
> don't get all it's possibilities by now. ;)

Thanks :)

Honestly, I am still discovering possibilities (and combinations of  
possibilities) with Moose/Class::MOP myself.

- Stevan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.