Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe use Exporter #31

Open
oalders opened this issue Dec 1, 2021 · 0 comments
Open

Maybe use Exporter #31

oalders opened this issue Dec 1, 2021 · 0 comments

Comments

@oalders
Copy link

oalders commented Dec 1, 2021

Hi @manwar!

I think this module could use Exporter rather than always installing every available function into the caller's namespace. As it stands, I think perlimports will need to ignore this module (which is fine), but I'm wondering if there's a compelling reason for the current import logic.

sub import {
    my $self   = shift;
    my $caller = caller;
 
    {
        no strict 'refs';
        *{$caller.'::strict_ok'}         = \&strict_ok;
        *{$caller.'::warnings_ok'}       = \&warnings_ok;
        *{$caller.'::syntax_ok'}         = \&syntax_ok;
        *{$caller.'::all_perl_files_ok'} = \&all_perl_files_ok;
        *{$caller.'::all_cover_ok'}      = \&all_cover_ok;
    }
 
    $Test->exported_to($caller);
    $Test->plan(@_);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant