in reply to deconstructing String::Iota - not worth one iota
Exports trim into caller's namespace. This is even more evil than usual because trim is such a favourite subroutine name among programmers. In other words, it is highly likely that use-ing String::Iota unexpectedly overwrites an existing subroutine.Of course not. First of all, it's highly unlikely String::Iota is going to widely used. Second, if there's a potential clash, or if people want to avoid a potential clash, people will explicitly import. And once people explicitly import, it doesn't make one iota difference whether the default export set of a module is empty or not. All an empty @EXPORT does is setting up an annoying default (people tend to use (non-OO) modules to its subroutines - therefore, exporting all or a subset of the modules by default makes good sense in many cases). Note also that if you want to use a module, but not want to import any of its symbols, all the caller needs to do is typing two extra characters. Third, so what if there's a clash? It's not that Perl doesn't give a warning the first time you compile the program (and you do have warnings turned on, don't you?). Fourth, if you're going to use a module X which exports routines Y and Z, would you name your own functions Y or Z? Nope, you'd pick something else. People don't just use modules willy-nilly and start reading what it does afterwards.
|
---|