An alternative suggestion: If Math::Int64 is loaded and you're on a perl without quad support, *then* set the default to yes. Does that sound a bit more reasonable?
Is probing ::VERSION or %INC the really right way to do things and changing your behavior based on what PMs are already in the process really a good idea?
What if module A is loaded by main::, which uses Win32::API internally, loads Math::Int64 and uses the quads as Math::Int64 objects, then module B is loaded by main::, which uses Win32::API internally, does not load Math::Int64, and uses quads as 8 byte strings, now module B will fatally error since it didn't pass a Math::Int64 to Win32::API and instead passed a 8 byte string quad, because of the global probing of what modules are already loaded into the process.
One solution to this problem in a non-Perl setting I saw was, to create a root "global settings" object, and then the main object is generated from a root global settings object. Each module/Library creates usually 1 global settings object for itself, but this way the global settings are library specific, not really global to the process. I dont know what to think about this solution.
caller probing for the caller's stash and maintain a "global" settings DB for each caller's stash, or caller peeking in Perl is too unreliable and unprofessional?
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.