The use IO::Socket::INET; should be in the main if main is going to call it!
And that's exactly what I want to enforce.
Perhaps I didn't make myself clear enough. What I'm saying is that there is apparently no way right now to make sure that your script/module has a use (or require) statement for every module it's using.
It's happened to me on multiple occasions that I forgot to add a use statement (most often when adding the very first Data::Dumper debug message in a script), and instead of breaking right away the script would work fine until I removed an unrelated module which did happen to use Data::Dumper.
(Of course you can very well make the argument that not checking to make sure you've included all needed modules is sloppy coding.)
In reply to Re^2: Preventing used modules from leaking to main script
by Crackers2
in thread Preventing used modules from leaking to main script
by Crackers2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |