home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / buildSelf.al < prev    next >
Encoding:
Text File  |  2002-11-06  |  1.3 KB  |  62 lines

  1. # NOTE: Derived from ..\blib\lib\CGI\XMLForm\Path.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package CGI::XMLForm::Path;
  5.  
  6. #line 36 "..\blib\lib\CGI\XMLForm\Path.pm (autosplit into ..\blib\lib\auto\CGI\XMLForm\Path\buildSelf.al)"
  7. sub buildSelf {
  8.     my $self = shift;
  9.     my $prev = shift;
  10.  
  11.     if ($self->{_path} =~ s/\*$//) {
  12.         $self->{_repeat} = 1;
  13.     }
  14.  
  15. #    warn "Building from ", $self->{_path}, "\n";
  16.  
  17.  
  18.     my @parts = split('/', $self->{_path});
  19.     my @fullpath;
  20.     $self->{Relative} = 0;
  21.  
  22.     if ($self->{_path} !~ /^\//) {
  23.         # It's a relative path
  24.  
  25.         $self->{_relative} = 1;
  26.         @fullpath = @{$prev->{_fullpath}};
  27.  
  28.         if ($prev->isRelative) {
  29.             # prev was a relative path so remove top item
  30.             pop @fullpath;
  31.         }
  32.         foreach ( @parts ) {
  33.             if ($_ eq "..") {
  34.                 pop @fullpath;
  35.             }
  36.             else {
  37.                 push @fullpath, $_;
  38.             }
  39.         }
  40.     }
  41.     else {
  42.         # remove crap from beginning (empty because of preceding "/")
  43.         shift @parts;
  44.         @fullpath = @parts;
  45.     }
  46.  
  47.     if ($fullpath[$#fullpath] =~ /^\@(\w+)$/) {
  48.         pop @fullpath;
  49.         pop @parts;
  50.         $self->{_attrib} = $1;
  51.     }
  52.  
  53.     $self->{Parts} = \@parts;
  54.     $self->{_fullpath} = \@fullpath;
  55.  
  56. #    warn "Built: ", $self->FullPath, "\n";
  57.  
  58. }
  59.  
  60. # end of CGI::XMLForm::Path::buildSelf
  61. 1;
  62.