Just because your module interacts with objects of a certain class doesn't mean it needs to pull in that class.If your module interacts with objects of a certain class, and the code of that class hasn't been pulled in, your program will die.
Now, either your module "pulls" in the code, or some other module has already done so. In the former case, the "use" prevents your program from crashing, in the latter case, all that's lost is some triviality at compile time ("Oh, golly, they want me to "pull in" this module - lemme see, I've already done that! Nothing to do").
Don't get me wrong, I don't advocate using modules you aren't going to use (in fact, I often use 'require Module' in a sub if I just need that module in the sub, and the sub isn't commonly called), but your example, and suggestion how to deal with it don't really convince me.
In reply to Re: general rule for using use
by JavaFan
in thread general rule for using use
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |