Ovid wrote:

I like the idea of this module.  Lots of people like the idea of
'aliased'.  Would it be worth combining the two?

  use My::Enterprise::Framework;
  use relative -aliased => qw(Customer Report);

  # instead of:
  # my $customer = My::Enterprise::Framework::Customer->new($id);
  # use:
  my $customer = Customer->new($id);

Hmm.. As is, relative.pm already allows you to do that (thanks to Ken Williams' suggestion):

    package My::Enterprise::Framework;
    use relative;
    my $Customer = import relative qw(Report Customer);
    my $customer = $Customer->new($id);

That is, import returns the full names of the successfully loaded modules in list context, or the last one in scalar context. Is this sufficient or did I misunderstand you?


--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.


Reply via email to