perl_help26 has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I would like to export constants from a file global_constants.pm. The traditional way to export them is:
package global_constants; use strict; use warnings; use base 'Exporter'; use constant LOAD_ARABIC=>1; use constant LOG_USERS_ACTIONS=>1; use constant ENABLE_RCSE=>; our @EXPORT_OK = ('LOAD_ARABIC','LOG_USERS_ACTIONS','ENABLE_RCSE'); 1;
And in the perl file test.pl:
use global_constants('LOAD_ARABIC' , 'LOG_USERS_ACTIONS','ENABLE_RCSE');Is it possible to export everything at once (i.e. without listing the names of the constants in the export of both files?? I have so many constants and i need a neater way to export (preferably without any module) Thanks :))
Back to
Seekers of Perl Wisdom