It's quite a while since you raised this ... :-)
The enum module doesn't export the symbols for you. The basic way to do this is as follows.
Let's say you have a class DaysOfTheWeek, in DaysOfTheWeek.pm, and you want it to export the symbols for the days of the week:
package DaysOfTheWeek;
use parent qw(Exporter);
use enum qw(Mon Tue Wed Thu Fri Sat Sun);
our @EXPORT = qw(Mon Tue Wed Thu Fri Sat Sun);
1;
That has duplication of the days of the week, which isn't good ("don't repeat yourself"), so you could rewrite that as:
package DaysOfTheWeek;
BEGIN {
our @EXPORT = qw(Mon Tue Wed Thu Fri Sat Sun);
}
use parent qw(Exporter);
use enum @EXPORT;
1;
You have to define @EXPORT in a BEGIN block, so it's available for the 'use enum', which runs at compile time.