note
rhesa
I was going to suggest that maybe the following pattern might be stylistically sound:
<c>
sub something {
use Foo;
# ...
no Foo;
}
</c>
I was reminded of this by both lexical pragmata like <c>strict</c>, and [mod://Moose] which advocates that in its code samples.
<p>
The module in question would need to have a functioning <c>unimport</c> implementation, and a quick test with [mod://Exporter] showed me that Exporter doesn't give you that for free, so it's probably not usually the case that <c>no Foo</c> would work at all.
<p>
However, even if <c>Foo</c> had implemented <c>unimport</c>, I doubt it'd work inside subs. And I'm afraid I'm not fascinated enough to investigate further (because I don't see much practical value). I'll just agree with the general sentiment that <c>use</c> clauses preferably go near the top of the file.
670475
670475