PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|Perl|site_perl|HTML|TreeBuilder.pm =

page 9 of 19



          : (), ".\n"
      ;
      
      print $indent, " (Current lineage: ", join('/', @lineage_tags), ".)\n"
       if DEBUG > 1;
       
      if(DEBUG > 3) {
        #my(
        # $package, $filename, $line, $subroutine,
        # $hasargs, $wantarray, $evaltext, $is_require) = caller;
        print $indent,
          " (Called from ", (caller(1))[3], ' line ', (caller(1))[2],
          ")\n";
      }
      
    #} else {
    #  $indent = ' ';
    }
    # End of if DEBUG
    
    # Now actually do it
    my @to_close;
    if($tag eq '*') {
      # Special -- close everything up to (but not including) the first
      #  limiting tag, or return if none found.  Somewhat of a special case.
     PARENT:
      while (defined $p) {
        $ptag = $p->{'_tag'};
        print $indent, " (Looking at $ptag.)\n" if DEBUG > 2;
        for (@stop) {
          if($ptag eq $_) {
            print $indent, " (Hit a $_; closing everything up to here.)\n"
             if DEBUG > 2;
            last PARENT;
          }
        }
        push @to_close, $p;
        $p = $p->{'_parent'}; # no match so far? keep moving up
        print
          $indent, 
          " (Moving on up to ", $p ? $p->{'_tag'} : 'nil', ")\n"
         if DEBUG > 1;
        ;
      }
      unless(defined $p) { # We never found what we were looking for.
        print $indent, " (We never found a limit.)\n" if DEBUG > 1;
        return;
      }
      #print
      #   $indent,
      #   " (To close: ", join('/', map $_->tag, @to_close), ".)\n"
      #  if DEBUG > 4;
      
      # Otherwise update pos and fall thru.
      $self->{'_pos'} = $p;
    } elsif (ref $tag) {
      # Close the first of any of the matching tags, giving up if you hit
      #  any of the stop-tags.
     PARENT:
      while (defined $p) {
        $ptag = $p->{'_tag'};
        print $indent, " (Looking at $ptag.)\n" if DEBUG > 2;
        for (@$tag) {
          if($ptag eq $_) {
            print $indent, " (Closing $_.)\n" if DEBUG > 2;
            last PARENT;
          }
        }
        for (@stop) {
          if($ptag eq $_) {
            print $indent, " (Hit a limiting $_ -- bailing out.)\n"
             if DEBUG > 1;
            return; # so it was all for naught
          }
        }
        push @to_close, $p;
        $p = $p->{'_parent'};
      }
      return unless defined $p; # We went off the top of the tree.
      # Otherwise specified element was found; set pos to its parent.
      push @to_close, $p;
      $self->{'_pos'} = $p->{'_parent'};
    } else {
      # Close the first of the specified tag, giving up if you hit
      #  any of the stop-tags.
      while (defined $p) {
        $ptag = $p->{'_tag'};
        print $indent, " (Looking at $ptag.)\n" if DEBUG > 2;
        if($ptag eq $tag) {
          print $indent, " (Closing $tag.)\n" if DEBUG > 2;
          last;
        }
        for (@stop) {
          if($ptag eq $_) {
            print $indent, " (Hit a limiting $_ -- bailing out.)\n"
             if DEBUG > 1;
            return; # so it was all for naught
          }
        }
        push @to_close, $p;
=9=

1|2|3|4|5|6|7|8| < PREV = PAGE 9 = NEXT > |10|11|12|13|14|15|16|17|18|19

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.00666189 wallclock secs ( 0.01 usr + 0.01 sys = 0.02 CPU)