Exporter::Constants - Declare constants and export it.
package My::Constants; # declare constants and push to @EXPORT use parent qw/Exporter/; our @EXPORT; our @EXPORT_OK; use Exporter::Constants ( \@EXPORT => { 'TYPE_A' => 4649, 'TYPE_B' => 5963 }, \@EXPORT_OK => { 'TYPE_C' => 1919, 'TYPE_D' => 0721 } ); package main; use My::Constants; # constants are exported. print TYPE_A, "\n";
This module help to declare & export constants.
I want to declare My::Own::Constants package when writing applications. These class declares constants and export to other application classes.
I can do this task by Exporter.pm and constants.pm. But I want to do it at once.
Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Exporter::Constants, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Exporter::Constants
CPAN shell
perl -MCPAN -e shell install Exporter::Constants
For more information on module installation, please visit the detailed CPAN module installation guide.