Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: What is Exported from modules (explicit!)

by tye (Sage)
on Jul 12, 2005 at 19:24 UTC ( #474364=note: print w/replies, xml ) Need Help??

in reply to What is Exported from modules


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, Inc.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://474364]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2022-01-21 19:40 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (59 votes). Check out past polls.