I have the following problem:

The module variable "$Log::TraceMessages::On" tells all calls to
"trace()" to print an argument (1) or not to (0).

Now, I'd like to split my program between my own module and my own
file using it. I'd like as well to use "trace()" for different
purposes during the execution of my program: for example, from command
line, setting trace 'on' only in the scope of my component or in the
scope of other files or not setting it at all. Some kind of tracing
level implementation.

The Log::TraceMessages module pod says that making the variable
"local" would do it. Unfortunately, I failed to see how I can set the
local scope to a _whole_ _file_ instead of a block like the doc says:

  {   # ok but not file _scope_  
      local $Log::TraceMessages::On = 0;
      t 'this message will not be printed';
  }

  # this is what I'd like, but fail to do that in my module file
  local $Log::TraceMessages::On = $trace;

Any idea how to do tha?
-- 
        Claude

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


Reply via email to