in reply to Extract Name of Parent Directory
You can do it pretty easily with regex. You might just want to use the File::Basename though.
$ perl -MFile::Basename -le 'print dirname("/htdocs/project1/docs/file +.html")' /htdocs/project1/docs
-sauoq "My two cents aren't worth a dime.";
|
|---|