Ken Williams wrote:

If there were a return value from import(), they could do something like this instead:

        package BigApp::Report;

        use relative;
        my $Pub = import relative to_self => qw(Create Publish);
        my $p = $Pub->new;

Except that, 1), the API has changed a bit, 2) I think import should return a list in this case because it's importing several modules at once. So would write it like this:

    package BigApp::Report;

    use relative;
    my ($Create, $Publish) = import qw(Create Publish);
    my publisher = $Publish->new;

Looks a good idea. It should also DTRT so

    my $Publish = import qw(Publish);

works as one expects. The only case left is:

    my $What = import qw(One Two Three);

It could return the last one in order to mimic the comma operator.


--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.


Reply via email to