# Exporter::Tiny::Manual::Etc - odds and ends - perldoc - [phpMan]

## NAME
    [Exporter::Tiny::Manual::Etc](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny%3A%3AManual%3A%3AEtc/markdown) - odds and ends

## DESCRIPTION
### Utility Functions
    [Exporter::Tiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny/markdown) is itself an exporter!

    These functions are really for internal use, but can be exported if you need them:

### mkopt
        Similar to "mkopt" from [Data::OptList](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AOptList/markdown). It doesn't support all the fancy options that
        [Data::OptList](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AOptList/markdown) does ("moniker", "require_unique", "must_be" and "name_test") but runs about
        50% faster.

### mkopt_hash
        Similar to "mkopt_hash" from [Data::OptList](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AOptList/markdown). See also "mkopt".

### History
    [Type::Library](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ALibrary/markdown) had a bunch of custom exporting code which poked coderefs into its caller's stash.
    It needed this to be something more powerful than most exporters so that it could switch between
    exporting Moose, Mouse and Moo-compatible objects on request. [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) would have been
    capable, but had too many dependencies for the [Type::Tiny](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny/markdown) project.

    Meanwhile [Type::Utils](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3AUtils/markdown), [Types::TypeTiny](https://www.chedong.com/phpMan.php/perldoc/Types%3A%3ATypeTiny/markdown) and [Test::TypeTiny](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3ATypeTiny/markdown) each used the venerable Exporter.pm.
    However, this meant they were unable to use the features like [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown)-style function
    renaming which I'd built into [Type::Library](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ALibrary/markdown):

       ## import "Str" but rename it to "String".
       use [Types::Standard](https://www.chedong.com/phpMan.php/perldoc/Types%3A%3AStandard/markdown) "Str" => { -as => "String" };

    And so I decided to factor out code that could be shared by all Type-Tiny's exporters into a
    single place: [Exporter::TypeTiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATypeTiny/markdown).

    As of version 0.026, [Exporter::TypeTiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATypeTiny/markdown) was also made available as [Exporter::Tiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny/markdown), distributed
    independently on CPAN. CHOCOLATEBOY had convinced me that it was mature enough to live a life of
    its own.

    As of version 0.030, Type-Tiny depends on [Exporter::Tiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny/markdown) and [Exporter::TypeTiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATypeTiny/markdown) is being phased
    out.

### Obligatory Exporter Comparison
    Exporting is unlikely to be your application's performance bottleneck, but nonetheless here are
    some comparisons.

    Comparative sizes according to [Devel::SizeMe](https://www.chedong.com/phpMan.php/perldoc/Devel%3A%3ASizeMe/markdown):

       Exporter                     217.1Kb
       [Sub::Exporter::Progressive](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter%3A%3AProgressive/markdown)   263.2Kb
       [Exporter::Tiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny/markdown)               267.7Kb
       Exporter + [Exporter::Heavy](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3AHeavy/markdown)   281.5Kb
       [Exporter::Renaming](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ARenaming/markdown)           406.2Kb
       [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown)                701.0Kb

    Performance exporting a single sub:

                  Rate     SubExp    ExpTiny SubExpProg      ExpPM
    SubExp      2489/s         --       -56%       -85%       -88%
    ExpTiny     5635/s       126%         --       -67%       -72%
    SubExpProg 16905/s       579%       200%         --       -16%
    ExpPM      20097/s       707%       257%        19%         --

    ([Exporter::Renaming](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ARenaming/markdown) globally changes the behaviour of Exporter.pm, so could not be included in
    the same benchmarks.)

    (Non-Core) Dependencies:

       Exporter                    -1
       [Exporter::Renaming](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ARenaming/markdown)           0
       [Exporter::Tiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny/markdown)               0
       [Sub::Exporter::Progressive](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter%3A%3AProgressive/markdown)   0
       [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown)                3

    Features:

                                          ExpPM   ExpTiny SubExp  SubExpProg
     Can export code symbols............. Yes     Yes     Yes     Yes
     Can export non-code symbols......... Yes     Yes
     Groups/tags......................... Yes     Yes     Yes     Yes
     Export by regexp.................... Yes     Yes
     Bang prefix......................... Yes     Yes
     Allows renaming of subs.............         Yes     Yes     Maybe
     Install code into scalar refs.......         Yes     Yes     Maybe
     Can be passed an "into" parameter...         Yes     Yes     Maybe
     Can be passed an "installer" sub....         Yes     Yes     Maybe
     Config avoids package variables.....                 Yes
     Supports generators.................         Yes     Yes
     Sane API for generators.............         Yes     Yes
     Unimport............................         Yes

    (Certain [Sub::Exporter::Progressive](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter%3A%3AProgressive/markdown) features are only available if [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) is installed.)

## SEE ALSO
    <<https://exportertiny.github.io/>>.

    [Exporter::Shiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3AShiny/markdown), [Exporter::Tiny](https://www.chedong.com/phpMan.php/perldoc/Exporter%3A%3ATiny/markdown).

## AUTHOR
    Toby Inkster <<tobyink@cpan.org>>.

## COPYRIGHT AND LICENCE
    This software is copyright (c) 2013-2014, 2017, 2022-2023 by Toby Inkster.

    This is free software; you can redistribute it and/or modify it under the same terms as the Perl
    5 programming language system itself.

## DISCLAIMER OF WARRANTIES
    THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
    WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
    PURPOSE.

