Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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?


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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://220566]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-10-17 22:35 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (239 votes). Check out past polls.