cvs commit: p5ee/App-Context/lib App.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     04/02/27 06:25:10

  Modified:    App-Context/lib App.pm
  Log:
  rename trace_subs to trace
  
  Revision  Changes    Path
  1.11      +20 -21    p5ee/App-Context/lib/App.pm
  
  Index: App.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Context/lib/App.pm,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- App.pm	9 Feb 2004 22:04:37 -0000	1.10
  +++ App.pm	27 Feb 2004 14:25:10 -0000	1.11
  @@ -1,6 +1,6 @@
   
   #############################################################################
  -## $Id: App.pm,v 1.10 2004/02/09 22:04:37 spadkins Exp $
  +## $Id: App.pm,v 1.11 2004/02/27 14:25:10 spadkins Exp $
   #############################################################################
   
   package App;
  @@ -291,9 +291,9 @@
           open(App::DEBUG_FILE, $debug_file);
       }
   
  -    $App::trace_subs = 0;
  -    if ($App::options{trace}) {
  -        $App::trace_subs = 1;
  +    $App::trace = 0;
  +    if (defined $App::options{trace}) {
  +        $App::trace = $App::options{trace};
       }
   }
   
  @@ -348,7 +348,7 @@
   my (%used);
   
   sub use ($) {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace);
       my ($self, $class) = @_;
       return if (defined $used{$class});
       if ($class =~ /^([A-Za-z0-9_:]+)$/) {
  @@ -365,7 +365,7 @@
           );
       }
       $used{$class} = 1;
  -    &App::sub_exit() if ($App::trace_subs);
  +    &App::sub_exit() if ($App::trace);
   }
   
   #############################################################################
  @@ -460,7 +460,7 @@
   =cut
   
   sub new {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace);
       my $self = shift;
       return $self->context() if ($#_ == -1);
       my $class = shift;
  @@ -472,17 +472,17 @@
           my $method = ($#_ > -1) ? shift : "new";
           if (wantarray) {
               my @values = $class->$method(@_);
  -            &App::sub_exit(@values) if ($App::trace_subs);
  +            &App::sub_exit(@values) if ($App::trace);
               return(@values);
           }
           else {
               my $value = $class->$method(@_);
  -            &App::sub_exit($value) if ($App::trace_subs);
  +            &App::sub_exit($value) if ($App::trace);
               return($value);
           }
       }
       print STDERR "Illegal Class Name: [$class]\n";
  -    &App::sub_exit(undef) if ($App::trace_subs);
  +    &App::sub_exit(undef) if ($App::trace);
       return undef;
   }
   
  @@ -547,7 +547,7 @@
                   # multiple named contexts are allowed for debugging purposes
   
   sub context {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace);
       my $self = shift;
   
       my ($name, $options, $i);
  @@ -558,7 +558,6 @@
       else {                                     # named args were supplied ...
           if (ref($_[0]) eq "HASH") {                 # ... as a hash reference
               $options = shift;                # note that a copy is *not* made
  -            $name = shift if ($#_ % 2 == 0);   # get name if it exists (odd#)
               for ($i = 0; $i < $#_; $i++) {            # copy other named args
                   $options->{$_[$i]} = $_[$i+1];        # into the options hash
               }
  @@ -600,17 +599,17 @@
           $context{$name} = $self->new($options->{context_class}, "new", $options);
       }
   
  -    &App::sub_exit($context{$name}) if ($App::trace_subs);
  +    &App::sub_exit($context{$name}) if ($App::trace);
       return($context{$name});
   }
   
   sub shutdown {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace);
       my ($self, $name) = @_;
       $name = "default" if (!defined $name);
       $context{$name}->shutdown() if (defined $context{$name});
       delete $context{$name};
  -    &App::sub_exit() if ($App::trace_subs);
  +    &App::sub_exit() if ($App::trace);
   }
   
   #############################################################################
  @@ -639,10 +638,10 @@
   =cut
   
   sub conf {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace);
       my $self = shift;
       my $retval = $self->context(@_)->conf();
  -    &App::sub_exit($retval) if ($App::trace_subs);
  +    &App::sub_exit($retval) if ($App::trace);
       $retval;
   }
   
  @@ -663,10 +662,10 @@
   =cut
   
   sub info {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace);
       my $self = shift;
       my $retval = "App-Context ($App::VERSION)";
  -    &App::sub_exit($retval) if ($App::trace_subs);
  +    &App::sub_exit($retval) if ($App::trace);
       return($retval);
   }
   
  @@ -700,7 +699,7 @@
   =cut
   
   sub sub_entry {
  -    if ($App::trace_subs) {
  +    if ($App::trace) {
           my ($stacklevel, $calling_package, $file, $line, $subroutine, $hasargs, $wantarray);
           $stacklevel = 1;
           ($calling_package, $file, $line, $subroutine, $hasargs, $wantarray) = caller($stacklevel);
  @@ -796,7 +795,7 @@
   =cut
   
   sub sub_exit {
  -    if ($App::trace_subs) {
  +    if ($App::trace) {
           $calldepth--;
           my ($stacklevel, $calling_package, $file, $line, $subroutine, $hasargs, $wantarray);
           $stacklevel = 1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.