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.";
In reply to Re: Extract Name of Parent Directory
by sauoq
in thread Extract Name of Parent Directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |