On 08/30/2007 09:37 AM, Beginner wrote:
[...]

I tried the INIT option and that worked also and I liked the fact that my `perl -c myscript.pl` sent it's output to screen and not my log file and I can use a scalar for logfile. q1) Does this still give me the effect of getting any errors from the other modules directed to our $logfile?


Probably not. There's no better way than to try it and see if it works. Read "perldoc perlmod" too.

q2) Will our $logfile now be a shared variable across all my modules?


Try it and see.

q3) The $debug/verbose question: Will I have to pass subroutines in other modules the $debug value if I am going to ask for more output, or if I do the same to $debug as I did with $logfile, use our instead of my. Will that allow those subroutines to check if debug is enabled?

Sorry seem to have added more questions somehow?
Dp.



Most people create a logging module if they want total control over logging. That module might have a packag $debug_level variable that determines how much information is logged.

However, the Perl error and warning messages don't fit your logging model, so you'll probably have to write something yourself or find it on CPAN.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to