...actually seems like requires the application writer to write a lot more code then if you just returned an object and letting them assign to a global variable...

Do you know, I think I may agree with you. In mod_perl, people tend to preach against globals, because of the number of people trying to convert their CGI to run under mod_perl. But of course, there are times when it makes sense to use a global.

I remember now, the other reason I wanted to import a sub rather than using an object directly was for more conciseness, as in:

@hostnames = C('db.servers'); as opposed to: @hostnames = $c->C('db.servers');

... not much of a difference, I'd agree, but at the time, I was trying to get it as small as possible.

It suits me to use it this way (ie the subclassing), but I can imagine more people than yourself experiencing the same objections. It wouldn't take much for me to change it to be able to work in either way, as the user desires.

So given that change, would you recommend that I release this module? And if so, called what? There is an old module of mine called Config::Loader which I doubt anyone has ever used - would this be a reasonable name? It doesn't mention the YAML, but that may be no bad thing, in case I want to add the ability to read other types of data.

thoughts?

thanks clint


In reply to Re^6: RFC: A YAML config module to be posted to CPAN by clinton
in thread RFC: A YAML config module to be posted to CPAN by clinton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.