Import-Into
view release on metacpan or search on metacpan
so within an eval, that's the scope of the eval itself, not the module
that just "use"d you - so
sub import {
eval "use strict;"
}
doesn't do what you wanted, but
sub import {
strict->import;
}
will apply strict to the calling file correctly.
Of course, now you have two new problems - first, that you still need to
know if something's a pragma, and second that you can't use either of
these approaches alone on something like Moose or Moo that's both an
exporter and a pragma.
So, a solution for that is:
lib/Import/Into.pm view on Meta::CPAN
within an eval, that's the scope of the eval itself, not the module that
just C<use>d you - so
sub import {
eval "use strict;"
}
doesn't do what you wanted, but
sub import {
strict->import;
}
will apply L<strict> to the calling file correctly.
Of course, now you have two new problems - first, that you still need to
know if something's a pragma, and second that you can't use either of
these approaches alone on something like L<Moose> or L<Moo> that's both
an exporter and a pragma.
So, a solution for that is:
( run in 0.724 second using v1.01-cache-2.11-cpan-299005ec8e3 )