On Sat, Oct 06, 2007 at 04:53:00PM +0200, S?bastien Aperghis-Tramoni wrote:

> 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

Hmm, the last example is equivalent to this:

    use relative qw(to Enterprise::Framework Base Factory);

Which might conceivably cause a problem for someone at some point.  You
might consider requiring the string ':to' instead of 'to'.

Paul.

-- 
Paul Hoffman <[EMAIL PROTECTED]>

Reply via email to