I have a code in Insert::Foo which is meant to run in each requirer's package:
# Insert/Foo.pm our $foo = 1; 1; # Client1.pm package Client1; require Insert::Foo; # $Client1::foo is set by Insert::Foo ... 1; # Client2.pm package Client2; require Insert::Foo; # $Client2::foo is set by Insert::Foo ... 1;
However, if I load Client2 and then Client3, Insert::Foo is not require'd again in Client3, because all modules are only loaded once. I can use do() instead of require(), but then I have to deal with filenames. I can manipulate %INC, but it feels hackish. Surely there's a proper mechanism for doing something like this?
In reply to Require into package by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |