in reply to module review
Here's a snippet from 'perldoc perlmodlib':@EXPORT = qw/ nbanners nports nplugin nwebdirs nnfs nos /;
There's also a good section in "Programming Perl" 3rd Edition about creating modules and using Exporter - starts on p.302. If you don't have this book, I'd highly recommend getting it - it is *THE* perl reference book. I also remember seeing a section about creating modules in the book "Effective Perl Programming".· Select what to export. Do NOT export method names! Do NOT export anything else by default without a good reason! Exports pollute the namespace of the module user. If you must export try to use @EXPORT_OK in preference to @EXPORT and avoid short or common names to reduce the risk of name clashes. Generally anything not exported is still accessible from outside the module using the ModuleName::item_name (or "$blessed_ref->method") syntax. By convention you can use a leading underscore on names to indicate informally that they are ’internal’ and not for public use. As a general rule, if the module is trying to be object oriented then export nothing. If it’s just a collection of functions then @EXPORT_OK anything but use @EXPORT with caution.
|
|---|