Ovid wrote:

> --- Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> wrote:
>
> > Eric Wilhelm wrote:
> > >>      use relative;
> > >>      my $Customer = import relative qw(Report Customer);
> > >
> > > This changes the require() on Foo::Report and Foo::Customer to run-
> > > time though, right?
> >
> > Right, but I'd say that for writing object-oriented code, there isn't
> > such a need to do things at compile time, is it?
>
> You know, I hadn't considered the runtime/compile-time issue when I
> first saw this.  Eric's right that this does change the semantics.  I
> suppose one could wrap it in a BEGIN block, but that makes it worse:
>
>   use relative;
>   my ( $Report, $Customer );
>   BEGIN {
>       ( $Report, $Customer ) = import relative qw(Report Customer);
>   }
>
> I do get tired of writing code like that (it happens a lot in test
> suites when I have "use_ok $CLASS" in a BEGIN block).
>
> I do agree that with OO modules that compile-time should be less of an
> issue, but it's not universally the case.  Still, I think the "import
> relative" is probably enough for me.

To be honest, I'm not really convinced because I don't see why so much
things should happen at compile-time, but I'll add the -aliased option
in the next release.


-- 
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.

Reply via email to