I have filenames like:
I want to basically remove the path for each variable.$file1 = C:\test\abc.txt $file2 = C:\test\file2.txt $file3 = P:\cool\file3.txt
Hence,
etc...$file1 = abc.txt $file2 = files2.txt
Please suggest how to grab everything till the last "\" and substitute it for nothing.
I was thinking this:
Please advice.$file =~ s/.*\\?//
Updated Steve_p - added code tags
In reply to substituting file names by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |