I'd try to simplify the "unless" clause, just to make it easier to comprehend:
...
unless ( $resfile eq "_RES_NODEFAULTS" ) {
# do the normal (default) resource inits...
}
if ( $resfile and $resfile ne "_RES_NODEFAULTS" ) {
# read resources from $resfile...
}
...
As for the documentation, the hierarchy (1.1 vs. 1.2 vs. 2) doesn't really help. There are just three different possible invocations for "new()", involving the single argument that it can take:
- the literal string "_RES_NODEFAULTS" -- returns a completely empty object, with no resource values set
- no argument at all (or empty string) -- assigns default values to a core set of resources
- the name of a resource file -- can assign non-default values to core resources, and/or define additional resources
I haven't looked at the rest of the module, so I'm guessing that those descriptions are appropriate. In any case, I hope the docs will clarify what the "core" resources are, how the default values make sense, what a resource file should look like, and what constraints, if any, apply to defining additional resources.
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.