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

Re^3: brian's Guide to Solving Any Perl Problem (@EXPORT_OK++)

by tye (Sage)
on Feb 07, 2005 at 23:11 UTC ( [id://428906]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^2: brian's Guide to Solving Any Perl Problem
in thread brian's Guide to Solving Any Perl Problem

Most style guides I work under ask for the full package name of external functions

What an awful idea. Just being explicit about what you import from any module you use is a much better idea. @EXPORT is evil but @EXPORT_OK makes for easier-to-read/-write code and provides reasonable interface verification (at compile time, no less). demerphq already said all of this, but I just boggle at the sentence I quoted so I had to chime in against such insanity.

- tye        

  • Comment on Re^3: brian's Guide to Solving Any Perl Problem (@EXPORT_OK++)

Replies are listed 'Best First'.
Re^4: brian's Guide to Solving Any Perl Problem (@EXPORT_OK++)
by JavaFan (Canon) on Aug 25, 2010 at 07:27 UTC
    If the importing module uses an explicit import list, @EXPORT isn't any more evil than @EXPORT_OK is. @EXPORT provides a default list to import. It's up to the user of the module to decide whether to use the default or not. I very seldomly write a module that has an empty @EXPORT and a non-empty @EXPORT_OK. Not providing defaults isn't very friendly in my book.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://428906]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.