Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Namespace Pollution

by vladb (Vicar)
on May 05, 2003 at 19:42 UTC ( #255733=note: print w/replies, xml ) Need Help??


in reply to Namespace Pollution

Answering your question whether it is right or wrong to import ':all' methods into client code, I think it depends. I like importing all methods for simple modules and in cases where I am absolutely sure no conflicts would arise. Examples of a few such modules are Date::Manip and Data::Dumper.

One way to avoid having to deal with the namespace pollution issue in your code, you might try to make use of an OO interface to your modules. Unfortunately not all have one implemented for them, in which case you might resort to selectively importing only the most often used methods, leaving the rest outside of your namespace ;)

_____________________
# Under Construction

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://255733]
help
Chatterbox?
[erix]: ( also: UniCorn Throne )
[zentara]: erix I hope both tusks pointed in the same direction :-)
LanX "♪..♫ Last night a DJ killed my wife ♪..♫ "
zentara...oO 1 more reason I prefer Perl to Python is I can't believe how long Python takes to compile, and you can't disable the myriad of tests
[LanX]: so that's where you've been the last two years? Compiling Python?
[zentara]: LanX no! I was learning why Krishna made me into a unicorn. :-)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-03-30 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (361 votes). Check out past polls.