The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Const::Fast::Exporter - create a module that exports Const::Fast immutable variables

SYNOPSIS

Create your module that defines the constants:

 package MyConstants;
 use Const::Fast::Exporter;

 const our $ANSWER => 42;
 const our @COLORS => qw/ red green blue /;
 const our %ORIGIN => { x => 0, y => 0 };

 1;

And then to use the constants:

 use MyConstants;

 print "The answer = $ANSWER\n";

DESCRIPTION

This module is helpful if you want to create a module that defines Const::Fast immutable variables, which are then exported. The SYNOPSIS provides just about everything you need to know. When you use Const::Fast::Exporter, it loads Const::Fast for you, which is why there isn't a use Const::Fast line in the SYNOPSIS.

Note: the interface should be considered unstable. At the moment it is very simple -- it just exports all symbols. Possibly there should be an option to specify whether everything is an optional export, with a -all switch. Maybe you'd do something like:

 use Const::Fast::Exporter -requested;

Which says that people have to specifically request the constants they want, rather than getting all of them by default.

If you want to define tags, then you should probably just use Exporter or similar.

SEE ALSO

Const::Fast - lets you define read-only scalars, hashes, and arrays.

Const::Exporter - another module you can use to create your own module that exports constant and immutable variables.

Exporter::Constants - declare and export function-based constants, similar to those declared with the constant pragma.

Constant::Exporter - declare and export function-based constants.

Constant::Export::Lazy - create a module that exports constants, where the value is only generated the first time its used.

REPOSITORY

https://github.com/neilb/Const-Fast-Exporter

AUTHOR

Neil Bowers <neilb@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Neil Bowers <neilb@cpan.org>.

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