helper routines for using Sub::Exporter to build methods

Edit Package perl-Sub-Exporter-ForMethods

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.

Refresh
Refresh
Source Files
Filename Size Changed
Sub-Exporter-ForMethods-0.100054.tar.gz 0000017241 16.8 KB
cpanspec.yml 0000000547 547 Bytes
perl-Sub-Exporter-ForMethods.changes 0000001363 1.33 KB
perl-Sub-Exporter-ForMethods.spec 0000002825 2.76 KB
Latest Revision
Yuchen Lin's avatar Yuchen Lin (maxlin_factory) accepted request 939838 from Yuchen Lin's avatar Yuchen Lin (maxlin_factory) (revision 2)
Automatically create request by update submitter. This is trying to update package to openSUSE:Backports:SLE-15-SP4 from openSUSE:Factory. Please review this change and decline it if Leap do not need it.
Comments 0
openSUSE Build Service is sponsored by