No description, website, or topics provided.
Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/Exporter
t
xt
.gitignore
.shipit
.travis.yml
Build.PL
Changes
LICENSE
MANIFEST
MANIFEST.SKIP
README.pod

README.pod

NAME

Exporter::Constants - Declare constants and export it.

SYNOPSIS

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";

DESCRIPTION

This module help to declare & export constants.

MOTIVATION

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.

AUTHOR

Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>

LICENSE

Copyright (C) Tokuhiro Matsuno

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