in reply to how do I get the directory name from the pathnames
If you don't know where in the path subdir1 will fall, then you may prefer to split the string using the '\' character as a separator.
If you are always after the second token, then something like this may work:
if (/^C:\\.*?\\(.*?)\\.*$/) { $subdir1 = $1; }
You may also find File::Basename helpful.
|
|---|