in reply to Namespaces & colliding names
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:
use File::Basename ();
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:
File::Basename::basename(...);
See the documentation for use.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Namespaces & colliding names
by Anonymous Monk on Nov 08, 2016 at 09:15 UTC |