use File::Basename to do this job
use File::Basename; $file1 = 'C:\test\abc.txt'; $file2 = 'C:\test\file2.txt'; $file3 = 'P:\cool\file3.txt'; $file1=basename($file1); $file2=basename($file2); $file3=basename($file3); print "$file1\n"; print "$file2\n"; print "$file3\n";
Output
abc.txt file2.txt file3.txt
In reply to Re: substituting file names
by gopalr
in thread substituting file names
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |