Sub::Import - import routines from most anything using Sub::Exporter
version 1.001
use Sub::Import 'Some::Library' => ( some_routine => { -as => 'some_other_name' }, other_routine => undef, );
Sub::Import is the companion to Sub::Exporter. You can use Sub::Import to get Sub::Exporter-like import semantics, even if the library you're importing from used Exporter.pm.
The synopsis above should say it all. Where you would usually say:
use Some::Library qw(foo bar baz);
...to get Exporter.pm semantics, you can now get Sub::Exporter semantics with:
use Sub::Import 'Some::Library' => qw(foo bar baz);
While you can rename imports, there is no way to customize them, because they are not being built by generators. At present, extra arguments for each import will be thrown away. In the future, they may become a fatal error.
Non-subroutine imports will not be importable via this mechanism.
The regex-like import features of Exporter.pm will be unavailable. (Will anyone miss them?)
Ricardo Signes <rjbs@cpan.org>
This software is copyright (c) 2013 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Sub::Import, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sub::Import
CPAN shell
perl -MCPAN -e shell install Sub::Import
For more information on module installation, please visit the detailed CPAN module installation guide.