Help for this page

Select Code to Download


  1. or download this
        my $path = "/dir1/dir2/dir3/ .. /dirn-1/dirLast//";
        my @pathary = split(/\//,$path);
    ...
    #    pop @path;                            # also
    #    my $parentpath = join('/',@pathary);  # works
        print "$path\n$parentpath\n";
    
  2. or download this
        use Cwd;
        my $oldpath = getcwd();
    ...
        $path = getcwd();
        print "$path\n";