Hi tye,

I finally found some time to try to understand your anwser, I think I did, and most of what you are saying makes sense to me.

So first, I'm using Log::Log4perl because when I looked at a module that could log things, it was one of the first to pop out, and with sufficient help on the web and good comments on it so I could easily learn to use it. (BTW I checked your Log::Lager, and didn't found it on CPAN as your link indicates, and on google I found it on v 0.04.XXX, so thanks for the alternative, but I will stick on Log::Log4perl a little bit longer...)

Secondly, yes my design is very poor, because I don't plan very much things when I'm coding, due to the fact that I'm quite a beginner (well not a complete one) on Perl and on developping script in a professionnal environment... So yes, my code is not very beautiful on those aspects, but I'm trying with the best I can do, but of course, it's not always (well I'd even say never) in the way of Perl, or the good practices with module programming...

So my original issue was : how can I have some coherent logging from my script AND my module (in the same file), without having to double the declaration of my logger ? (of course it would also be perfect if this solution was compatible with Log::Log4perl)

It seems you're quite knowledgeable on this subject, so I'm asking for help and guidance.

Thank you very much in advance for your answer.


In reply to Re^2: Can I from within a module access variables from the calling program? (modular design) by HJO
in thread Can I from within a module access variables from the calling program? by HJO

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.