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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.