Help for this page

Select Code to Download


  1. or download this
    # NOTE: I have already prepended pwd if needed
    
    ...
        $path =~ s#/[^/]+?/\.\.#/#;
    }
    
  2. or download this
    #remove .
    while ( $path =~ s#/\./#/# ) {;}
    
    #remove ..
    while ( $path =~ s#/[^/]+?/\.\./#/# ) {;}
    
  3. or download this
    while ( $path =~ s#(/[^/]+)?/\.(\.)?/defined($2) ? "/" : "$1/"/e ) {;}
    
  4. or download this
    unless ( chdir $path ) {
      die "Couldn't there ($path) from here\n";
    }
    return `pwd`;