NAME
Sub::Import - import routines from most anything using Sub::Exporter
VERSION
version 1.000
SYNOPSIS
use Sub::Import 'Some::Library' => (
some_routine => { -as => 'some_other_name' },
other_routine => undef,
);
DESCRIPTION
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);
WARNINGS AND LIMITATIONS
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?)
AUTHOR
Ricardo Signes <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 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.