in reply to Is "use" same as include?

Question: Can the use of "use" be considered same as the include file functionality?

No. require doesn't inline the file like C's #include, and loading a file without a package using require is wrong. It definitely won't work here. (use is implemented in terms of require.)

do might do the trick, but why not just use Exporter?

package MyConstants; use strict; use warnings; use Exporter qw( import ); use constant qw( ); my %constants = ( FOO => 1, BAR => 2, ); our @EXPORT = keys(%constants); our %EXPORT_TAGS = ( all => [ keys(%constants) ] ); constant->import(\%constants); 1;
or
package MyConstants; use strict; use warnings; use Exporter qw( import ); my %constants; BEGIN { %constants = ( FOO => 1, BAR => 2, ); } use constant \%constants; our @EXPORT = keys(%constants); our %EXPORT_TAGS = ( all => [ keys(%constants) ] ); 1;