Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: creating class base modules

by aging acolyte (Pilgrim)
on Dec 17, 2002 at 16:17 UTC ( #220566=note: print w/ replies, xml ) Need Help??


in reply to creating class base modules

On a similarly simple question regarding using classes.

What are the advantages/disadvantages in using

export= qw( &new &feed )
or export_ok

Do things need to be exported?

thanks

A.A. Update Sorry I realise that this is a bit off topic and should have appeared as an seperate question


Comment on Re: creating class base modules
Download Code
Re: Re: creating class base modules
by pfaut (Priest) on Dec 17, 2002 at 16:27 UTC

    export forces the listed symbols into the callers namespace. export_ok allows the listed symbols to be pulled into the callers namespace. export_ok is nicer as it gives the user of your module the choice. See Exporter for details.

    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 symbol names to reduce the risk of name clashes.
    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://220566]
help
Chatterbox?
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 2014-08-21 10:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (133 votes), past polls