1Exporter::Tiny(3) User Contributed Perl Documentation Exporter::Tiny(3)
2
3
4
6 Exporter::Tiny - an exporter with the features of Sub::Exporter but
7 only core dependencies
8
10 package MyUtils;
11 use base "Exporter::Tiny";
12 our @EXPORT = qw(frobnicate);
13 sub frobnicate { ... }
14 1;
15
16 package MyScript;
17 use MyUtils "frobnicate" => { -as => "frob" };
18 print frob(42);
19 exit;
20
22 Exporter::Tiny supports many of Sub::Exporter's external-facing
23 features including renaming imported functions with the "-as",
24 "-prefix" and "-suffix" options; explicit destinations with the "into"
25 option; and alternative installers with the "installer" option. But
26 it's written in only about 40% as many lines of code and with zero non-
27 core dependencies.
28
29 Its internal-facing interface is closer to Exporter.pm, with
30 configuration done through the @EXPORT, @EXPORT_OK and %EXPORT_TAGS
31 package variables.
32
33 If you are trying to write a module that inherits from Exporter::Tiny,
34 then look at:
35
36 • Exporter::Tiny::Manual::QuickStart
37
38 • Exporter::Tiny::Manual::Exporting
39
40 If you are trying to use a module that inherits from Exporter::Tiny,
41 then look at:
42
43 • Exporter::Tiny::Manual::Importing
44
46 Please report any bugs to
47 <https://github.com/tobyink/p5-exporter-tiny/issues>.
48
50 <https://exportertiny.github.io/>.
51
52 Simplified interface to this module: Exporter::Shiny.
53
54 Less tiny version, with more features: Exporter::Almighty.
55
56 Other interesting exporters: Sub::Exporter, Exporter.
57
59 Toby Inkster <tobyink@cpan.org>.
60
62 This software is copyright (c) 2013-2014, 2017, 2022-2023 by Toby
63 Inkster.
64
65 This is free software; you can redistribute it and/or modify it under
66 the same terms as the Perl 5 programming language system itself.
67
69 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
70 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
71 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
72
73
74
75perl v5.36.0 2023-04-02 Exporter::Tiny(3)