package App::Constants; # NOT its real name
use constant MAX_PRIORITY => 10000;
use constant DEFAULT_WIDTH => 7;
use constant MSG_DATA => [
{ # front
ID_LT => 480,
SEQ_LT => 481,
},
{ # back
ID_LT => 810,
SEQ_LT => 811,
},
];
use base qw(Exporter);
our @EXPORT_OK = qw(MAX_PRIORITY DEFAULT_WIDTH MSG_DATA);
our %EXPORT_TAGS = (default => \@EXPORT_OK);
1;
####
package App::Document;
use App::Constants qw(default);
sub apply {
foreach my $msg (@{&MSG_DATA}) {
some_func($msg->{ID_LT});
}
}
1;
####
@{+MSG_DATA}; # syntactic separation with unary plus
@{MSG_DATA()}; # function that returns reference to array
####
/#!/usr/bin/perl
use warnings;
use strict;
use brain;