http://www.perlmonks.org?node_id=474364


in reply to What is Exported from modules

Never:

use Some::Module;

Instead either:

use Some::Module qw( Things Used From This Module ); #or require Some::Module;

and you won't have this problem. If you're confused, just think how confused your replacement will be.

This is why module authors should use @EXPORT_OK and never @EXPORT.

And when I say "never" remember this: All things in the strictest of moderation, including moderation.

- tye        

Replies are listed 'Best First'.
Re^2: What is Exported from modules (explicit!)
by Codon (Friar) on Jul 12, 2005 at 20:32 UTC
    If you want to really confuse your replacement, do what my predecessor did: write class (has a new() method which returns a blessed reference) with methods that are named (by convention) as private ( sub _do_something { } ) or "double private" ( sub __double_secret_probation { } ) and then add them to @EXPORT. Oh, and while you're at it, add every subroutine to @EXPORT. That'll teach people to learn a convention and then have unfair expectations when they see it used elsewere.

    I think my predecessor lived (and may die) by this.

    Ivan Heffner
    Sr. Software Engineer, DAS Lead
    WhitePages.com, Inc.