Andy Armstrong wrote:

Would it also do

use relative [to => 'My::Big::Namespace'] => qw( This That Munger::Fast Munger::Precise );

It can easily do that. The problem is more the name. In this case, "use relative to ..." works well. But in y original example, "use subclass" works better. Maybe I should provide both modules then.

I always hesitate to suggest Aristotle is mistaken - it's not a common occurrence - but I really think 'subclass' is wrong. As you said this is an extension to the semantics of use that has (I presume) nothing to do with any inheritance relationship the modules may have with each other.

Mixing both your and Aristotle's suggestions, here is the new synopsis:

    package BigApp::Report;

    use relative qw(Create Publish);
    # loads BigApp::Report::Create, BigApp::Report::Publish

    use relative qw(..::Utils);
    # loads BigApp::Utils

    use relative to => "Enterprise::Framework" => qw(Base Factory);
    # loads Enterprise::Framework:Base, Enterprise::Framework::Factory


I quite like 'relative' to be honest. And I like the idea of the module. I'll use it immediately when you release it, thanks.

Heh, thanks. I'll announce here when the module is available.


--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.

Reply via email to