package MyConsts; use constant { CONST1 => 123, CONST2 => 1.11, CONST3 => "foo", CONST4 => ["foo", "bar"], }; use constant CONST5 => qw(foo bar); use Exporter 'import'; our @EXPORT = map /([^:]+)$/, keys %constant::declared; 1; #### #!/usr/bin/perl use strict; use warnings; use MyConsts; print CONST1, "\n"; # or some weirder cases (just to illustrate, # I understand that you only need integers) print "@{CONST4()}\n"; # -> foo bar print "@{[CONST5]}\n"; # -> foo bar print +(CONST5)[1], "\n"; # -> bar