Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Parent directory - regex

by periapt (Hermit)
on Jun 17, 2004 at 12:30 UTC ( #367596=note: print w/replies, xml ) Need Help??

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";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://367596]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-12-02 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?