[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
extracting last part of cwd
I apologize for the "newbie" nature of this question, but
dejanews has been down for 2 days so I can't post to the
newsgroup or search for answers.
I'm need to extract only the last element of the current working
directory and store it in a variable but can't figure out how.
For example, if my cwd is /home/lewst/News I need to extract only
"News" and store this in a variable.
I figured out how to store the entire cwd in a variable with:
use Cwd;
$mycwd = cwd;
Now how do I change this to hold only the last part of the cwd?
Much appreciated.
(Please CC: me on followups)
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
- Follow-Ups from:
-
Bennett Todd <bet@rahul.net>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]