in reply to Namespace/advice for new CPAN modules for Thai & Lao
I don't think there's one "correct" answer... If your modules mostly deal with Unicode issues (like properties), then perhaps the Unicode:: namespace might be appropriate. If your modules mostly provide regexes or extend regexes, Regexp:: does seem appropriate. If your modules provide a mix of features, but they're language-specific, then Lingua:: seems like a good place. The example you've shown seems like it might fit into Unicode::, but it also depends on the other modules in the distro.
As for exporting, if you've got a module that only exports functions named like the example you showed, then automatically exporting all of those is probably not really that bad, since they're probably unlikely to collide with existing functions. Then again, "modern" Perl modules generally don't do that so they don't flood the user's namespace, and Laurent_R is right that adding an :all tag is pretty easy:
use Exporter 'import'; our @EXPORT_OK = qw/ ... /; our %EXPORT_TAGS = ( all => \@EXPORT_OK );
(Note the use Exporter 'import'; instead of adding Exporter to @ISA, this prevents your module from inheriting several other Exporter functions and changing your module's @ISA, which may be important modules that also offer an OO interface.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Namespace/advice for new CPAN modules for Thai & Lao
by Polyglot (Chaplain) on Mar 23, 2015 at 04:14 UTC | |
Re^2: Namespace/advice for new CPAN modules for Thai & Lao
by Anonymous Monk on Mar 23, 2015 at 01:55 UTC |