in reply to Re^2: How relevant is the order of 'use's ?
in thread How relevant is the order of 'use's ?
Actually I think you can do even simpler/easier to read:
Since I guess your goal is to export all the constants in Demo2 without having to provide the list of names twice. And with the & appended to each name, there's no risk of overwriting $SUCCESS;use Exporter; use base qw/Exporter/; our %constants; BEGIN { push @ISA, 'EXPORTER'; %constants = (SUCCESS => 1); @EXPORT = map "&$_", keys %constants; } use constant \%constants;
In Section
Seekers of Perl Wisdom