in reply to Lexical use/no Module?

You can get lexical scoping of pragmas by using %^H and $^H (which see), but there are some problems with doing that currently; the most significant is that you only have access to the correct scoped setting at compile-time (e.g. within the scope of a use foo or no foo code run at compile time will be able to tell which of use or no was in effect, but not at run-time.

This has been pretty high on the list of things it would be nice to clean up in perl5. Dominus has done some work toward cleaning this up. See his grant proposal for more information (though the 5.8.2 obviously doesn't apply, and I'm not sure this would belong in a maintenance release, anyway). Last I heard, he was hoping to work on this more by April '04.

Yes, I know I've complained at others using %^H, but that was for a specific case for which there is a documented stable interface; there isn't a general interface yet to %^H because (IMO) the existing support for user pragmas isn't good enough to justify one. Still, one needs to be aware that %^H may vanish from future releases.