Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: My first perl module

by chipmunk (Parson)
on Dec 03, 2001 at 08:24 UTC ( #129035=note: print w/replies, xml ) Need Help??


in reply to My first perl module

Refering to the documentation for the Exporter module, we see that the entries in @EXPORT are exported by default, but the entries in @EXPORT_OK are exported only if the calling package asks for them.

@EXPORT_OK is very useful for limiting namespace pollution. For example, you might have two modules, each of which has a genHeader method. If they both export genHeader by default, only the one imported second will stick. Whereas if they export genHeader on request, you can import the one you know you want and there will be no confusion.

If you have a lot of entries in @EXPORT_OK, you can create a tag to allow someone to import a bunch of methods/variables without having to list them all. See Exporter and perlmodlib for more.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2020-01-18 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?