Hello! First post here.
How is it that package->import imports package into the caller?
I know that I can do the following:
{ package Base; use strict; use warnings; sub import { strict->import; warnings->import; } } { package A; use Base; # Now A has strict and warnings }
… but how does that work? Why is it that Base::import{… strict->import;} is the same as {package A; use strict;}?
Is there an implicit argument to import that’s being passed that tells it to import into the calling package? Or am I misunderstanding a core aspect of use/import behavior?
In reply to import() into caller by assist/control
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |