"a" <> wrote in news:FYiCf.454345$ki.271648@pd7tw2no:
> I have an input string. It is a full path of a file.
> eg. //server/dirA/dirB/file.txt
> How can I parse it into directory and file?
> i.e //server/dirA/dirB/ and file.txt
This is not just string manipulation. It is path and file name
manipulation. As such, you'd better served by using File::Spec. Using the
module would help make your script more portable.
> Also, I have a directory as an input.
> e.g //server/dirA/dirB/
> How can I check the last character is a / or not?
If you use File::Spec->catfile, you need not worry about that.
Sinan
--
A. Sinan Unur <>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html