Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Namespaces & colliding namesby Athanasius (Archbishop) |
on Nov 08, 2016 at 08:24 UTC ( [id://1175521]=note: print w/replies, xml ) | Need Help?? |
Hello jahero, and welcome to the Monastery! You can control what is imported by specifying imports explicitly as part of the use declaration. For example, if you change your code to:
then the basename function in File::Basename will not be imported, so defining your own sub basename will not produce a namespace collision. If you then wanted to call the function of that name in File::Basename, you would need to qualify it fully:
See the documentation for use. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|