Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Parent directory - regex

by pbeckingham (Parson)
on Jun 17, 2004 at 13:06 UTC ( #367601=note: print w/replies, xml ) Need Help??


in reply to Parent directory - regex

With a regex, I'd do this, but I would ordinarily use File::Basename to do this:

my ($parent) = "/dir1/dir2/dir3/ .. /dirLast//" =~ m#^(.*)/.*?//$#;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2022-12-03 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?