The synopsis section, above, looks almost indistinguishable from any other use of Sub::Exporter, apart from the use of 'method_installer'. It is nearly indistinguishable in behavior, too. The only change is that subroutines exported from Method::Builder into named slots in Vehicle::Autobot will be wrapped in a subroutine called 'Vehicle::Autobot::transform'. This will insert a named frame into stack traces to aid in debugging.
More importantly (for the author, anyway), they will not be removed by namespace::autoclean. This makes the following code work:
package MyLibrary;
use Math::Trig qw(tan); # uses Exporter.pm use String::Truncate qw(trunc); # uses Sub::Exporter's defaults
use Sub::Exporter::ForMethods qw(method_installer); use Mixin::Linewise { installer => method_installer }, qw(read_file);
use namespace::autoclean;
...
1;
After MyLibrary is compiled, 'namespace::autoclean' will remove 'tan' and 'trunc' as foreign contaminants, but will leave 'read_file' in place. It will also remove 'method_installer', an added win.
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
0.100055-bp156.2.1 info | GA Release | 2023-07-22 | 15 SP6 |
|
|
0.100055-bp155.1.6 info | GA Release | 2023-05-17 | 15 SP5 |
|
|
0.100054-bp154.1.34 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
0.100052-bp153.1.16 info | GA Release | 2021-03-05 | 15 SP3 |
|
|
0.100052-bp152.3.20 info | GA Release | 2020-04-17 | 15 SP2 |
|
|
0.100052-bp151.3.1 info | GA Release | 2019-07-16 | 15 SP1 |
|
|
0.100052-bp151.2.13 info | GA Release | 2019-05-18 | 15 SP1 |
|
|
0.100052-bp150.2.4 info | GA Release | 2018-07-30 | 15 |
|
|